changeext 221 B

123456789101112
  1. #!/bin/csh
  2. set fromext = $1
  3. set toext = $2
  4. shift
  5. shift
  6. foreach f ( $* )
  7. set fromname = `basename $f $fromext`$fromext
  8. if ( $f == $fromname ) then
  9. set toname = `basename $f $fromext`$toext
  10. mv $f $toname
  11. endif
  12. end