Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Re: undo a tar



Quoth Shawn (Thu 2004-08-05 11:08:18PM +0900):

> I need to strip "OOo_1.1.2_LinuxIntel_install/" from each arg before it 
> gets passed to rm
> 
> for i in `tar tfz ~/downloads/OOo_1.1.1_LinuxIntel_install.tar.gz`; do echo 
> "$i"|cut -c 30-;done
> will print out the files I want to rm such as
> f_0430
> f_0431
> f_0432
> 
> but
> for i in `tar tfz ~/downloads/OOo_1.1.1_LinuxIntel_install.tar.gz`; do rm 
> "$i"|cut -c 30-;done
> gives me
> rm: cannot remove `OOo_1.1.1_LinuxIntel_install/f_0432': No such file or 
> directory

A-ha. Sorry, I was not paying attention. You could always:

tar tzf ~/downloads/OOo_1.1.1_LinuxIntel_install.tar.gz | \
perl -ne '/^[^\/]+\/(.+)$/ and unlink $1'

-- 
Josh Glover

Gentoo Developer (http://dev.gentoo.org/~jmglov/)
Tokyo Linux Users Group Listmaster (http://www.tlug.jp/)

GPG keyID 0xDE8A3103 (C3E4 FA9E 1E07 BBDB 6D8B  07AB 2BF1 67A1 DE8A 3103)
gpg --keyserver pgp.mit.edu --recv-keys DE8A3103

Attachment: pgp00006.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links