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

Re: extracting tarball to a location other than ./



Kamaraju Kusumanchi <kk288@cornell.edu> writes:

> The above method will not function as intended, if the destdir is not
> present. So I would go with
>
> cat tarfile.tgz | (cd destdir && tar xzvf -)

Sure :)

Maybe even better

 (cd destdir) && cat tarfile.tgz | (cd destdir && tar xzvf -)

which avoids even the cat in case 'cd destdir' fails.

Regards, Bruno.



Reply to: