From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tsh@mrc-lmb.cam.ac.uk Newsgroups: gmane.os.tru64.managers Subject: tar with -C and wildcard Date: Mon, 14 Apr 2003 11:10:19 +0100 (BST) Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <200304141010.LAA342399@alf1.mrc-lmb.cam.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1050315040 5310 80.91.224.249 (14 Apr 2003 10:10:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 14 Apr 2003 10:10:40 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Mon Apr 14 12:10:36 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1950ux-0001N6-00 for ; Mon, 14 Apr 2003 12:10:27 +0200 Original-Received: (qmail 1204 invoked by uid 5); 14 Apr 2003 10:10:53 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 1162 invoked by uid 49493); 14 Apr 2003 10:10:52 -0000 Original-Received: from tsh@mrc-lmb.cam.ac.uk by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(0.3/5.0):. Processed in 0.406358 secs); 14 Apr 2003 10:10:52 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (160.91.86.17) by 0 with SMTP; 14 Apr 2003 10:10:52 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HDB006BNWA3CV@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 14 Apr 2003 06:10:51 -0400 (EDT) Original-Received: from rose.csi.cam.ac.uk (rose.csi.cam.ac.uk [131.111.8.13]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HDB00864W98FE@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 14 Apr 2003 06:10:21 -0400 (EDT) Original-Received: from server1.mrc-lmb.cam.ac.uk ([131.111.85.23]) by rose.csi.cam.ac.uk with esmtp (Exim 4.12) id 1950uq-0004LZ-00 for tru64-unix-managers@ornl.gov; Mon, 14 Apr 2003 11:10:20 +0100 Original-Received: from alf1.mrc-lmb.cam.ac.uk ([131.111.85.78]) by server1.mrc-lmb.cam.ac.uk with esmtp (Exim 4.10) id 1950uq-0001O0-00 for tru64-unix-managers@ornl.gov; Mon, 14 Apr 2003 11:10:20 +0100 Original-Received: by alf1.mrc-lmb.cam.ac.uk (8.9.3) id LAA342399; Mon, 14 Apr 2003 11:10:20 +0100 (BST) Original-To: Managers X-Mailer: ELM [version 2.4ME+ PL66 (25)] Xref: main.gmane.org gmane.os.tru64.managers:3960 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:3960 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.