1822101 Members
3498 Online
109640 Solutions
New Discussion юеВ

Re: remove extension

 
SOLVED
Go to solution
Oliver_39
Occasional Contributor

remove extension

hi
I need a script to rename myfile.dat to myfile
there are many of these files with the same extension

thanks
2 REPLIES 2
Rick Garland
Honored Contributor
Solution

Re: remove extension

for filedat in `ls *.dat`
do
shortname=`echo $filedat | awk -F. '{print $1}'`
mv $filedat $shortname
done

Oliver_39
Occasional Contributor

Re: remove extension

..