| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can instruct tar to send the contents of each extracted
file to the standard input of an external program:
Extract files and pipe their contents to the standard input of
command. When this option is used, instead of creating the
files specified, tar invokes command and pipes the
contents of the files to its standard output. The command may
contain command line arguments. The program is executed via
sh -c. Notice, that command is executed once for each regular file
extracted. Non-regular files (directories, etc.) are ignored when this
option is used.
The command can obtain the information about the file it processes from the following environment variables:
TAR_FILETYPEType of the file. It is a single letter with the following meaning:
f | Regular file |
d | Directory |
l | Symbolic link |
h | Hard link |
b | Block device |
c | Character device |
Currently only regular files are supported.
TAR_MODEFile mode, an octal number.
TAR_FILENAMEThe name of the file.
TAR_REALNAMEName of the file as stored in the archive.
TAR_UNAMEName of the file owner.
TAR_GNAMEName of the file owner group.
TAR_ATIMETime of last access. It is a decimal number, representing seconds since the Epoch. If the archive provides times with nanosecond precision, the nanoseconds are appended to the timestamp after a decimal point.
TAR_MTIMETime of last modification.
TAR_CTIMETime of last status change.
TAR_SIZESize of the file.
TAR_UIDUID of the file owner.
TAR_GIDGID of the file owner.
Additionally, the following variables contain information about tar mode and the archive being processed:
TAR_VERSIONGNU tar version number.
TAR_ARCHIVEThe name of the archive tar is processing.
TAR_BLOCKING_FACTORCurrent blocking factor (see section Blocking).
TAR_VOLUMEOrdinal number of the volume tar is processing.
TAR_FORMATFormat of the archive being processed. See section Controlling the Archive Format, for a complete list of archive format names.
If command exits with a non-0 status, tar will print
an error message similar to the following:
tar: 2345: Child returned status 1 |
Here, ‘2345’ is the PID of the finished process.
If this behavior is not wanted, use ‘--ignore-command-error’:
Ignore exit codes of subprocesses. Notice that if the program exits on signal or otherwise terminates abnormally, the error message will be printed even if this option is used.
Cancel the effect of any previous ‘--ignore-command-error’
option. This option is useful if you have set
‘--ignore-command-error’ in TAR_OPTIONS
(see TAR_OPTIONS) and wish to temporarily cancel it.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Sergey Poznyakoff on March, 12 2011 using texi2html 1.78.