* tar with -C and wildcard
@ 2003-04-14 10:10 tsh
0 siblings, 0 replies; only message in thread
From: tsh @ 2003-04-14 10:10 UTC (permalink / raw)
TU64 5.1 PK5
Good morning all,
We have a curious problem with tar - I cant believe no-one has
tried this before, but also cant see what we may be doing wrong.
The following command fails instantly (no tape motion) with 'No Match'
error:
tar cvf $tape -C /somedirectory file*
but works of we cd to /somedirectory and then just
tar cvf $tape file*
e.g. (using /dev/null for testing)
%tar cvf /dev/null -C /ss1/tsh bootnet*
tar: No match.
But:
% tar -cvf /dev/null -C /ss1/tsh bootnet.img_6.2 bootnet.img_7.0
a bootnet.img_6.2 2880 Blocks
a bootnet.img_7.0 2880 Blocks
And:
%cd /ss1/tsh
%tar -cvf /dev/null bootnet*
a bootnet.img_6.2 2880 Blocks
a bootnet.img_7.0 2880 Blocks
Furthermore, if I am cd'd to directory A, which has files junk* in it,
then type
tar cvf $tape -C /someOtherDirectory junk*
or
tar cvf $tape -C /someOtherDirectory ./junk*
tar complains:
tar: junk : No such file or directory
tar: junk.bak : No such file or directory
tar: junk.c : No such file or directory
tar: junk.dialup : No such file or directory
tar: junk.ps : No such file or directory
tar: junkjunk : No such file or directory
tar: junkkk : No such file or directory
tar: junkz : No such file or directory
which are the names of files in directory A, not those in someOtherDirectory.
Escaping the * with \* simply makes it search for a filename with a * as
part of the name. I cant believe we havent done things like this before,
the only thing I can think of is the we upgraded to PK5 a couple of
months ago, but THE SAME THING HAPPENS WITH (an old) GNUTAR!
What am I doing wrong? Please put me out of my misery!
Cheers,
Terry.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-04-14 10:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 10:10 tar with -C and wildcard tsh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox