dpaule
asked on
Remove character "-" in a selected range of file names within a directory
Is there an easy way to remove the character "-" from the files below using sed other unix command?:
1-58284-000-8.gif
1-58284-001-6.gif
1-58284-002-4.gif
1-58284-003-2.gif
1-86156-313-2.gif
1-86156-383-3.gif
1582840008.gif
1582840016.gif
1582840024.gif
1582840032.gif
1861563132.gif
1861563833.gif
Thanks,
David
1-58284-000-8.gif
1-58284-001-6.gif
1-58284-002-4.gif
1-58284-003-2.gif
1-86156-313-2.gif
1-86156-383-3.gif
1582840008.gif
1582840016.gif
1582840024.gif
1582840032.gif
1861563132.gif
1861563833.gif
Thanks,
David
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
guessing ...
perl -e'for(@ARGV){($f=$_)=~s(- )()g;print "rename $_,$f";}'
and if that is what you want, then use
perl -e'for(@ARGV){($f=$_)=~s(- )()g;renam e $_,$f;}'
perl -e'for(@ARGV){($f=$_)=~s(-
and if that is what you want, then use
perl -e'for(@ARGV){($f=$_)=~s(-
for i in *.gif
do
mv $i `echo $i | tr -d "-"`
done