Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Question about making a tarball
Date: Fri, 01 May 2009 08:42:31
Message-Id: 20090501094222.7a7031f7@zaphod.digimed.co.uk
In Reply to: Re: [gentoo-user] Re: Question about making a tarball by Dale
1 On Fri, 01 May 2009 03:04:05 -0500, Dale wrote:
2
3 > > Tar needs to be given files or directories to include, you didn't and
4 > > that's why it refused to make an empty archive. Since -C chnges to the
5 > > directory you want to backup, you use . to tell it to backup the (now)
6 > > current directory.
7
8 > Would using a wild card work? Like this; /mnt/gentoo/* Just curious.
9
10 No, because the -C has already changed the working directory
11 to /mnt/gentoo, so /mnt/gentoo/* would go back to where you were before
12 (because of the leading/). Using * on its own wouldn't work, because
13 the shell would expand it before running the tar command. Also, using
14 * would exclude hidden files. You've been given a working command, why
15 look for a more complex but flawed alternative?
16
17 tar -C somewhere -blah
18
19 is equivalent to
20
21 cd somewhere
22 tar -blah
23 cd ${OLDPWD}
24
25 and workd for both creation and extraction. As you are already using it
26 for extraction, why not maintain consistency and use it for creation too?
27
28 > And to think that I thought a period was only needed for the end of a
29 > sentence. Learn something new every day I guess.
30
31 . = current directory
32 .. = parent directory
33
34 --
35 Neil Bothwick
36
37 Are you sure this isn't the time for a colorful metaphor?

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Re: Question about making a tarball Dale <rdalek1967@×××××.com>