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. 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:
Type of the file. It is a single letter with the following meaning:
Currently only regular files are supported.
File mode, an octal number.
The name of the file.
Name of the file as stored in the archive.
Name of the file owner.
Name of the file owner group.
Time 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
Time of last modification.
Time of last status change.
Size of the file.
UID of the file owner.
GID of the file owner.
In addition to these variables, TAR_VERSION contains the
GNU tar version number.
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.
Published under the terms of the GNU General Public License