Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!bruce!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.unix.wizards Subject: Re: Copying Multiple Files Message-ID: <3133@goanna.cs.rmit.oz.au> Date: 2 Jun 90 10:48:43 GMT References: <23368@adm.BRL.MIL> <16512@phoenix.Princeton.EDU> <207@taumetCOM> <13022@ulysses.att.com> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 19 In article <4a9c480e.12c9a@digital.sps.mot.com> chen@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."