if you have a file name in a variable
filename = test.csv
then just use this to get the "csv" part:
echo ${filename##*.}
works for bash, try it in ksh
edit:
filename=test.csv fileext=${filename##*.} if [ fileext = "csv" ]; then echo "file is csv, do something" else if [ fileext = "dat" ]; then echo "file is dat, do something" else echo "mhh what now?" fi fi
source share