On Mon 08 Sep 2003 at 14:45:30, Hans Fugal said:
> * Grant Robinson [Mon, 8 Sep 2003 at 14:37 -0600]
> <quote>
> >
> > On Monday, September 8, 2003, at 02:23 PM, Jan L. Peterson wrote:
> >
> > >How about something like this:
> > >
> > >for f in auto-*; do
> > > cp $f targetdir/no$f
> > >done
> >
> > Sorry, I guess auto and no auto was a bad example. What I really need
> > to know is how to capture the number for use in a new filename. so
> > auto-1 becomes bongo-1, and auto-2 becomes bongo-2, etc.
>
> If you're reluctant to use perl or some other scripting language
> (ruby ;-) then it sounds like you want sed or perhaps cut.
Nah, bash will do this all by itself:
for f in auto*; do cp ${f} targetdir/bongo-${f##auto-}; done
--
Soren Harward
[EMAIL PROTECTED]
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list