Remove file suffix in Bash
Posted: Wed May 16, 2012 8:34 pm
A clean way for removing a file suffix (.jpg, .txt, ...) using only bash-internal syntax is as follows:
This will output:
Code: Select all
FILE="bla.txt"
NAME="${FILE%.*}"
echo $NAME
bla