[ale] tar weirdness

Michael D. Hirsch mhirsch at nubridges.com
Fri Jan 24 10:51:47 EST 2003


On Friday 24 January 2003 09:58 am, James P. Kinney III wrote:
> Tar is not working the way I think it is suppose to. I want to tarball a
> directory EXCEPT for files ending in .gdbm
>
> tar cvzf tarball.tar.gz --exclude dir/*.gdbm dir
>
> All it tars ARE the gdbm files. Does tar not support globing?

The man page and the info page on tar disagree on the usage of this flag.  
The man page says:
--exclude FILE           
	exclude file FILE
But the info page says:
 `--exclude=PATTERN'
      Causes `tar' to ignore files that match the PATTERN.
 
In general, the GNU info pages are more correct.  The info page claim that 
globbing is supported, but they seem to imply that quoting of the * is a 
good idea.   
    The `--exclude=PATTERN' option prevents any file or member whose name
 matches the shell wildcard (PATTERN) from being operated on.  For
 example, to create an archive with all the contents of the directory
 `src' except for files whose names end in `.o', use the command `tar
 -cf src.tar --exclude='*.o' src'.
 

--Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list