bash
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| bash [2011/11/01 15:36] – yYdWOhSF 85.232.50.65 | bash [2021/02/01 05:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | NwSbpV | + | ====== bash programming tricks ====== |
| + | |||
| + | ===== extracting file extension ===== | ||
| + | |||
| + | file="example.pdf" | ||
| + | file_extension=`echo $file | sed 's/.*\.//'` | ||
| + | |||
| + | ===== removing file extension ===== | ||
| + | |||
| + | file="example.pdf" | ||
| + | file_extension=`echo $file | sed 's/.*\.//' | ||
| + | file_without_extension=`basename $file .$file_extension` | ||
| + | |||
bash.1320161762.txt.gz · Last modified: 2021/02/01 05:55 (external edit)
