Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A command to change a set of files' extension' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A command to change a set of files' extension
Authored by: kren2000 on Nov 13, '07 09:37:30PM
I wrote a quick shell script to do the same for people who don't want to use zsh as their main shell:
Karen-G4:~/bin karen$ more rnsuffix
#!/bin/zsh
if [ $# == 0 ]; then
  echo "$0: change filename suffixes"
  echo "Usage: $0 oldsuffix newsuffixf "
  echo "e.g.: $0 mp4 mov ==> will rename *.mp4 to *.mov "
  exit
fi


echo autoload -U zmv
echo "noglob zmv -W *.$1 *.$2"

autoload -U zmv
noglob zmv -W *.$1 *.$2

It's ugly but I'm sure some of the gurus here can clean it up.

[ Reply to This | # ]