2 ms·
This script seems like a nice way to use tar with 7-zip 16.02. All the script targets are hard-linked together, and the the tar needs to be created as 7za's st
by chasil 4y ago
This script seems like a nice way to use tar with 7-zip 16.02.
All the script targets are hard-linked together, and the the tar needs to be created as 7za's standard input with -si, not as a file.
$ cat ~/bin/7ctar
#!/bin/sh
zfile=$1
shift
case ${0##*/} in
7ltar) 7za x -so "$zfile" | tar tvf - "$@" ;;
7xtar) 7za x -so "$zfile" | tar xvf - "$@" ;;
7ctar) tar cvf - "$@" | 7za a -mx=9 -si "$zfile" ;;
esac
$ 7ctar test.tar.7z /etc/passwd /etc/group /etc/hosts
tar: Removing leading `/' from member names
/etc/passwd
/etc/group
/etc/hosts
...
$ 7ltar test.tar.7z
-rw-r--r-- root/root 3774 2021-11-17 12:52:56 etc/passwd
-rw-r--r-- root/root 948 2019-08-08 09:52:52 etc/group
-rw-r--r-- root/root 242 2017-08-31 09:57:40 etc/hosts
$ ../7xtar test.tar.7z
etc/passwd
etc/group
etc/hosts