How To Copy A Group of Files To Different Name?

Ruben de Groot mail25 at bzerk.org
Wed May 19 02:52:22 PDT 2004


> On Tue, 18 May 2004, Drew Tomlinson wrote:
> 
> > OK, thanks.  I'm using tcsh but I think I figure out how to do it
> > following your example.  So a "script" is the only way to do it in
> > *nix?  Being born and raised on MS-DOS, I'm accustomed to the "copy bac*
> > bac*.old" syntax.

On the command line (tcsh):

> ls bac*
bac1  bac2  bac3
> foreach file ( bac* )
foreach? cp -p $file $file.old
foreach? end
> ls bac*
bac1  bac1.old  bac2  bac2.old  bac3  bac3.old

cheers,
Ruben


More information about the freebsd-questions mailing list