In Cygwin/bash 'rename' is available:

$ rename .cpp .cc *.cpp

When I tried this using mksh, I got:

ksh: rename: syntax error

So I wrote:

#!/bin/mksh

for f in *.cpp; do
      base=`basename $f .cpp`
      mv $f $base.cc
done

Why was this necessary?

---John

Reply via email to