File: rename

package info (click to toggle)
dvipsk-ja 5.96%2Bjp1.7a-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,588 kB
  • ctags: 3,650
  • sloc: ansic: 31,432; sh: 10,348; makefile: 595; perl: 365; csh: 47; awk: 35
file content (13 lines) | stat: -rwxr-xr-x 195 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/sh
# rename: rename files accoring to expression.
# Copyright 1997 Olaf Weber <infovore@xs4all.nl>
# Public Domain.

expr="$1"
shift

for i
do
	j=`echo "$i" | sed "$expr"`
	mv $i $j
done