I want to get the filename (without extension) and the extension separately.
The best solution I found so far is:
NAME=`echo \"$FILE\" | cut -d\'.\'
This is the only one that worked for me:
path='folder/other_folder/file.js' base=${path##*/} echo ${base%.*} >> file
This can also be used in string interpolation as well, but unfortunately you have to set base beforehand.
base