ITEM: AG3807L

Does tar support wildcards?



Question:

ENV:    AIX 3.2.5

DESC: 
        
Customer used the following command to create a tar image:

  cd /usr/ud 
  tar -cvf /dev/rmt0 *

He then used a "tar -xvf /dev/rmt0 *" to extract a file, but 
it did not restore the subdirectories or files.  If he creates 
the subdirectories and runs the tar command, it will restore 
files. 

ACT:    

tar does not support wildcards.  tar can be used to backup 
files by wildcard but cannot extract the files from the tape.

The problems he is experienceing is because the shell is 
expanding the * wildcard. tar will restore only the 
directories specified.

The command tar -xvf /dev/rmt0 * evaluates to 

   tar -xvf /dev/rmt0 \. 

If the current directory contains entries that match ones on 
the tar archive then they will get restored.  If the current 
directory does not contain matching entries then nothing will 
get restored.

This probably should only work on absolute pathnames since 
it's hard to give a file a literal name of "./a_file_name" .

This is why he has to create an entry that matches one on the 
archive before tar will restore it. 

Tar itself, like most UN*X commands, does not process wildcards 
directly; it depends on the shell for this.



Support Line: Does tar support wildcards? ITEM: AG3807L
Dated: March 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:28
Comments or suggestions? Contact us