I think a similar program using SAS RENAME function would work in UNIX just as well as Windows.
I was fiddling with this one line bash script. It does not exectue 'MV' just shows the command with ECHO. It's really the same as your SAS program only different language. I think most folk would do some kind of GREP thing but I'm not good with that.
for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;
For each file that matches the pattern x*.xml
print the file name
assign x the filename with .xml removed
print the mv command
>for file in x*.xml; do echo "Process: $file"; x=`basename $file .xml`; echo "mv $file ${x}.txt"; done;
Process: xmltest.xml
mv xmltest.xml xmltest.txt
Process: xp1.xml
mv xp1.xml xp1.txt
Process: xp2.xml
mv xp2.xml xp2.txt
Assumes UNIX shell is BASH
... View more