[comp.unix.questions] Copying Multiple Files

tarvaine@tukki.jyu.fi (Tapani Tarvainen) (05/27/90)

In article <23368@adm.BRL.MIL> rose@baby.swmed.utexas.edu (Rose Oguz) writes:
>The original files have the same root name and different extensions.  How
>can I copy them to files with another root name while keeping the
>extensions? 

Just for fun, here's yet another way:

ls foo.* | sed 's/foo\(.*\)/mv foo\1 bar\1/' | sh

Just about any such conversion can be done this way, although
the command can get rather messy (nice way to convince novices
that you're a *nix guru ...)
-- 
Tapani Tarvainen    (tarvaine@jyu.fi, tarvainen@finjyu.bitnet)

tarvaine@tukki.jyu.fi (Tapani Tarvainen) (05/27/90)

In article <1990May26.182215.27766@tukki.jyu.fi> I wrote:
>>How can I copy them to files with another root name while keeping the
>>extensions? 

>ls foo.* | sed 's/foo\(.*\)/mv foo\1 bar\1/' | sh
                             ^^
Should've been "cp" of course.


-- 
Tapani Tarvainen    (tarvaine@jyu.fi, tarvainen@finjyu.bitnet)