tar: external
1
1 3.11 Running External Commands
1 ==============================
1
1 Certain GNU 'tar' operations imply running external commands that you
1 supply on the command line. One of such operations is checkpointing,
1 described above (⇒checkpoint exec). Another example of this
1 feature is the '-I' option, which allows you to supply the program to
11 use for compressing or decompressing the archive (⇒
use-compress-program).
1
1 Whenever such operation is requested, 'tar' first splits the supplied
1 command into words much like the shell does. It then treats the first
1 word as the name of the program or the shell script to execute and the
1 rest of words as its command line arguments. The program, unless given
1 as an absolute file name, is searched in the shell's 'PATH'.
1
1 Any additional information is normally supplied to external commands
1 in environment variables, specific to each particular operation. For
1 example, the '--checkpoint-action=exec' option, defines the
1 'TAR_ARCHIVE' variable to the name of the archive being worked upon.
1 You can, should the need be, use these variables in the command line of
1 the external command. For example:
1
1 $ tar -x -f archive.tar \
1 --checkpoint-action=exec='printf "%04d in %32s\r" $TAR_CHECKPOINT $TAR_ARCHIVE'
1
1 This command prints for each checkpoint its number and the name of the
1 archive, using the same output line on the screen.
1
1 Notice the use of single quotes to prevent variable names from being
1 expanded by the shell when invoking 'tar'.
1