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\'.\'
I use the following script
$ echo "foo.tar.gz"|rev|cut -d"." -f3-|rev foo