Copying Multiple Files
Richard A. O'Keefe
ok at goanna.cs.rmit.oz.au
Sat Jun 2 20:48:43 AEST 1990
In article <4a9c480e.12c9a at digital.sps.mot.com> chen at digital.sps.mot.com (Jinfu Chen) writes:
>I have yet to find a way in csh or bsh to do this simple task.
#!/bin/sh
# change "FromPattern" "ToPattern" File...
# see sed(1) for an explanation of patterns
From="$1"
shift
To="$1"
shift
for File
do
mv "$File" "`echo "$File" | sed -e "s/$From/$To/"`"
done
exit
--
"A 7th class of programs, correct in every way, is believed to exist by a
few computer scientists. However, no example could be found to include here."
More information about the Comp.unix.wizards
mailing list