[sclug] strip paths from file when tarring?

John Stumbles john at stumbles.org.uk
Sat Mar 5 23:59:14 UTC 2005


David Given wrote:

> (tar cf - foo/ bar/ && (cd long/path/to/ && tar cf - logfile.log)) \
>   | bzip2 -9vc > mytar.tar.bz2

oh, beg your pardon: so bzip2 _can_ compress from stdin ...


> (Incidentally, as a matter of shell scripting style: if you use && to 
> seperate commands instead of ; then if one command fails the whole thing 
> will stop. e.g.:
> 
> cd / ; cd this/directory/doesnt/exist ; rm -rf .
> 
> ...will do Bad Things. Using && will Not Do Bad Things.

point taken :-)



-- 
John Stumbles                                      mobile 0780 866 8204
plumbing:heating:electrical:property maintenance     home 0118 954 2406


More information about the Sclug mailing list