Change the filename variable value

Hi guys,

I have a variable where i am storing the filename (with full path).

I just need the value before ".txt". But instead of getting the filename i am getting the contents of the filename.

 
FileName=/appl/data/Input/US/Test.txt
a=`awk -F"." '{print $1}' ${FileName}`
echo $a
This is the conttent of a text file

Can somebody point out what i am doing wrong here.

Cheers!!!!

$ FileName=/appl/data/Input/US/Test.txt
$ a=`echo $FileName | cut -d. -f1`
$ echo $a
/appl/data/Input/US/Test

Do you need awk for that?

$ FileName=/appl/data/Input/US/Test.txt
$ echo ${FileName%.txt}                
/appl/data/Input/US/Test

thanks guys... :slight_smile: