$ mva *.htm *.html mv "file1.htm" "file1.html" mv "gorilla.htm" "gorilla.html"Here's how to name all files of the form stem.123.png to stem_123.png
$ mva *.*.png *_*.png mv "stem.000.png" "stem_000.png" mv "stem.001.png" "stem_001.png" mv "stem.002.png" "stem_002.png"Here's how to convert all your PPM files to PNG
$ mva pnmtopng *.ppm ">" *.png pnmtopng "file1.ppm" > "file1.png" pnmtopng "stem.000.ppm" > "stem.png"Why the double quotes on the command line? Well, without them the shell will try to make a file called "*.png". If you have one PNG file in your directory that would be disastrous.
mva -e *.htm *.html[For hackers: Actually I prefer to just pipe the output through the shell. For example, "mva *.htm *.html |sh", and then you can get verbose output using "sh -v"].
rename png jpg *.pngin a directory which contains the file png001.png, you will see the following rename:
png001.png jpg001.pngwhich is probably not what you wanted. On the other hand, "mva *png *jpg" will do the right thing. Of course in this case, "rename .png .jpg *.png" will work correctly, but not if you have periods somewhere else in the filename.
chsuf --from="htm" --to="html" *.htm
I still say however, that for most work, it's more convenient to write
mva *.htm *.htmlThan
shtool move -e *.htm %1.htmlbut I agree that's pretty arguable.
First you need to copy the perl script "mva.pl" into a directory in your PATH.
Then if you use BASH, copy mva.bashrc into your ~/.bashrc. Its contents are:
# beginning of .bashrc modifications for MVA
# Add this to your .bashrc to use mva
alias mva='set -o noglob ; mva_exec_and_reset_glob perl -S mva.pl '
mva_exec_and_reset_glob () {
$*
set +o noglob
}
# end of .bashrc modifications for MVA
If you use TCSH, copy mva.tcshrc into ~/.tchsrc. Its contents are
# beginning of .tcshrc modifications for MVA alias mva '(set noglob; exec perl -S mva.pl \!*)' # end of .tcshrc modifications for MVA
If you use another shell, you'll have to use MVA by calling the perl script directly and quoting the wildcards. For example, if you copy mva.pl to mva and make it executable, then you would say
mva "*.htm" "*.html"If you use another shell and can figure out the incantation equivalent to the two above to turn off globbing for a single command, please let me know.