Originally posted by: SystemAdmin
Is there an aix equivalent to the non-posix (but common) rename(1) command?
Where?
<desired>
rename(1) substitute filenames that match regular expressions
Summary:
rename 'match-regular-expression' 'replace-string' file
http://... </desired>
<example>
ksh> ls
abc.cpp vm.h foo.c bar.cpp x.C
ksh> rename '.cpp' '.C' *.cpp
ksh> ls
abc.C vm.h foo.c bar.C x.C
</example>
<example>
ksh> ls received
pic1.png pic2.png pic3.png
ksh> for f in received/*.png; do convert "$f" "$f".gif; done
ksh> ls received
pic1.png pic.png.gif pic2.png pic2.png.gif pic3.png pic3.png.gif
ksh> rename png.gif gif received/*.png.gif
ksh> ls received
pic1.png pic.gif pic2.png pic2.gif pic3.png pic3.gif
ksh> rm received/*.png
ksh> ls received
pic.gif pic2.gif pic3.gif
</example>
We are currently using a 20-line perl script which has hacked from a
2-line perl snippet.
Before spending time to identify the correct gnu package
and porting rename(1),
I am asking if there is already an aix equivalent extension (e.g. mv option)
TIA,
#AIX-Forum