Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2005 10:47:45 -0801
From:      Jos Backus <jos@catnook.com>
To:        freebsd-current@freebsd.org
Subject:   Re: Heads up: gtar gone from base system
Message-ID:  <20050329184807.GA38296@lizzy.catnook.local>
In-Reply-To: <02e501c5342c$75bca5b0$6800000a@venti>
References:  <20050329041527.GA9586@VARK.MIT.EDU> <20050329062550.GA69824@cirb503493.alcatel.com.au> <02e501c5342c$75bca5b0$6800000a@venti>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 29, 2005 at 01:56:14AM -0500, Brian K. White wrote:
[snip]
> >( cd srcdir ; tar cf - . ) | ( cd destdir ; tar xpf - )
> 
> All the first perens does is leave you sitting wherever you were before 
> starting, whereas my example would have left you sitting in srcdir.
> It makes no functional difference in the tar/untar job itself.

Not quite; without the first set of parentheses, destdir is interpreted
relative to srcdir. Unless srcdir are meant as symbolic values and dstdir has
an absolute value, in which case this is not an issue.

$ cd $HOME
$ pwd
/home/jos
$ (cd /; pwd 1>&2) | (cd /usr; pwd)
/
/usr
$ pwd
/home/jos
$ (cd /; pwd 1>&2) | (cd usr; pwd)
cd: can't cd to usr
/home/jos
/
$ pwd
/home/jos
$ cd /; pwd 1>&2 | (cd usr; pwd)
/
/usr
$ pwd
/
$ 

Note: /home/jos/usr doesn't exist.

-- 
Jos Backus
jos at catnook.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050329184807.GA38296>