delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/30/14:34:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: <wtung AT cisco DOT com>
From: "Wai-Yip Tung \(wtung\)" <wtung AT cisco DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: tar wildcard problem
Date: Mon, 30 Dec 2002 11:34:37 -0800
Message-ID: <002101c2b03a$7e5979a0$80d16b80@amer.cisco.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

I tried everything but non seems to work. This is my tar command:

  tar -T filename.txt -X xfilename.txt -cvWf $TAR_FILE

And here is my exclude file xfilename.txt:
./*.bak
'*.bak'
"*.bak"
*.bak
file.txt
file.bak

I have a workaround that does work.

  EXCLUDE_OPT=`cat exclude_opt.txt`
  tar -T filename.txt -X xfilename.txt $EXCLUDE_OPT -cvWf $TAR_FILE

This is my exclude_opt.txt file:
--exclude=*.class
--exclude=*.obj
--exclude=*.bak

But this is really not nice.

Wai yip Tung


-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf
Of Igor Pechtchanski
Sent: Monday, December 30, 2002 7:27 AM
To: Wai-Yip Tung (wtung)
Cc: cygwin AT cygwin DOT com
Subject: Re: tar wildcard problem


On Sun, 29 Dec 2002, Wai-Yip Tung (wtung) wrote:

> I got some problem using tar.
>
> * wildcard in -T doesn't work. If I include *.txt in the file list I 
> got
>
>   tar: *.txt: Cannot stat: No such file or directory
>
> However using *.txt in command line do work. Putting exact file name 
> or directory in the file list also works.
>
> * wildcard in -X file doesn't work. However, if I use it in --exclude 
> it does work. Putting exact file name doesn't work either. So -X does 
> nothing for me.
>
> The version information is
>
> tar (GNU tar) 1.13.25
> Copyright (C) 2001 Free Software Foundation, Inc.
> This program comes with NO WARRANTY, to the extent permitted by law. 
> You may redistribute it under the terms of the GNU General Public 
> License; see the file named COPYING for details.
> Written by John Gilmore and Jay Fenlason.
>
> Hope you can give me some suggestion.
> Thank you,
> Wai yip Tung

Wai,
Did you escape or quote the wildcards appropriately, so that tar expands
them instead of the shell?
	Igor
P.S. When asking a new question, it's usually better to start a new
thread, rather than replying to an old one, otherwise people with
threaded mail readers may not notice your query.
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big*
RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019