shell_patterns=0 ############################################################################## # %% The % character # %f The current file (if non-local vfs, file will be copied locally and # %f will be full path to it) # %p The current file # %d The current working directory # %s "Selected files"; the tagged files if any, otherwise the current file # %t Tagged files # %u Tagged files (and they are untagged on return from expand_format) # %view Runs the commands and pipes standard output to the view command # If %view is immediately followed by '{', recognize keywords # ascii, hex, nroff and unform # # If the format letter is in uppercase, it refers to the other panel # # With a number followed the % character you can turn quoting on (default) # and off. For example: # %f quote expanded macro # %1f ditto # %0f don't quote expanded macro # # Unused shortcuts: ! % ) 5 ^ f F g G h H I k K L M N n o O p P q Q t T v V ############################################################################## + ! t t @ Do something on the current file CMD=%{Enter command} $CMD %f + t t @ Do something on the tagged files CMD=%{Enter command} for i in %t ; do $CMD "$i" done =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r $ Display the file with roff -man %view{ascii,nroff} roff @MAN_FLAGS@ @MANDOC@ %f + f \.c$ & t r & ! t t 1 Compile and link current .c file make "`basename %f .c`" 2>/dev/null || cc -O -o "`basename %f .c`" %f + ! t t 2 Pack the current subdirectory (tar) Pwd=`basename %d /` echo -n "Name of the tarball (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf "$tar.tar" "$Pwd" && \ echo "../$tar.tar created." + t t 2 Pack tagged directories (tar) echo "[%t]" for tar in %t; do tar cf "$tar.tar" "$tar" && \ echo "$tar.tar created." done + ! t t 3 Compress the current subdirectory (tar.gz) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \ echo "../$tar.tar.gz created." + t t 3 Compress tagged subdirectories (tar.gz) for tar in %t; do tar cf - "$tar" | gzip -f9 > "$tar.tar.gz" && \ echo "$tar.tar.gz created." done + ! t t 4 Compress the current subdirectory (tar.bz2) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \ echo "../$tar.tar.bz2 created." + t t 4 Compress tagged subdirectories (tar.bz2) for tar in %t; do tar cf - "$tar" | bzip2 -f > "$tar.tar.bz2" && \ echo "$tar.tar.bz2 created." done + ! t t 6 Compress the current subdirectory (tar.xz) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \ echo "../$tar.tar.xz created." + t t 6 Compress tagged subdirectories (tar.xz) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for tar in %t; do tar cf - "$tar" | xz -f > "$tar.tar.xz" && \ echo "../$tar.tar.xz created." done + ! t t 7 Compress the current subdirectory (tar.zst) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | zstd $COMPRESS_OPTS_ZSTD -f > "$tar.tar.zst" && \ echo "../$tar.tar.zst created." + t t 7 Compress tagged subdirectories (tar.zst) for tar in %t; do tar cf - "$tar" | zstd $COMPRESS_OPTS_ZSTD -f > "$tar.tar.zst" && \ echo "$tar.tar.zst created." done + ! t t 8 Compress the current subdirectory (tar.lzo) Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ tar cf - "$Pwd" | lzop -f > "$tar.tar.lzo" && \ echo "../$tar.tar.lzo created." + t t 8 Compress tagged subdirectories (tar.lzo) for tar in %t; do tar cf - "$tar" | lzop -f > "$tar.tar.lzo" && \ echo "$tar.tar.lzo created." done + ! t t 9 Compress the current subdirectory (7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ ${P7ZIP} a $COMPRESS_OPTS_7Z "$tar.7z" "$tar" && \ echo "../$tar.7z created." + t t 9 Compress tagged subdirectories (7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for tar in %t; do ${P7ZIP} a $COMPRESS_OPTS_7Z "$tar.7z" "$tar" && \ echo "$tar.7z created." done + ! t t 0 Compress the current subdirectory (zip) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ zip -r "$tar.zip" "$tar" && \ echo "../$tar.zip created." + t t 0 Compress tagged subdirectories (zip) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for tar in %t; do zip -r "$tar.zip" "$tar" && \ echo "$tar.zip created." done + ! t t ( Compress and encrypt the current subdirectory (7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 Pwd=`basename %d /` echo -n "Name of the compressed file (without extension) [$Pwd]: " read tar [ "$tar"x = x ] && tar="$Pwd" cd .. && \ ${P7ZIP} a -p -mhe $COMPRESS_OPTS_7Z "$tar.7z" "$tar" && \ echo "../$tar.7z created." + t t ( Compress and encrypt tagged subdirectories (7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for tar in %t; do ${P7ZIP} a -p -mhe $COMPRESS_OPTS_7Z "$tar.7z" "$tar" && \ echo "$tar.7z created." done + t r & ! t t a Append file to opposite cat %f >> %D/%f + t t A Append files to opposite files for i in %t ; do cat "$i" >> %D/"$i" done + t r & ! t t d Delete file if a copy exists in the other directory if [ %d = %D ]; then echo "The two directories must be different" exit 1 fi if [ -f %D/%f ]; then # if two of them, then if cmp -s %D/%f %f; then rm %f && echo %f": DELETED." else echo %f" and "%D/%f" differ: NOT deleted" echo -n "Press RETURN " read key fi else echo %f": No copy in "%D/%f": NOT deleted" fi + t t D Delete tagged files if a copy exists in the other directory if [ %d = %D ]; then echo "The two directories must be different" exit 1 fi for i in %t ; do if [ -f %D/"$i" ]; then SUM1=`sum "$i"` SUM2=`sum %D/"$i"` if [ "$SUM1" = "$SUM2" ]; then rm "$i" && echo "$i: DELETED." else echo "$i and "%D"/$i differ: NOT deleted" fi else echo "$i has no copy in "%D": NOT deleted" fi done m View manual page MAN=%{Enter manual name} %view{ascii,nroff} MANROFFOPT='@MAN_FLAGS@' MAN_KEEP_FORMATTING=1 man -P cat "$MAN" = t r + ! t t r Copy file to remote host echo -n "To which host?: " read Host echo -n "To which directory on $Host?: " read Dir scp %f "${Host}:${Dir}" + t t R Copy files to remote host (no error checking) echo -n "Copy files to which host?: " read Host echo -n "To which directory on $Host? :" read Dir scp -r %u "${Host}:${Dir}" + ! t t l List compressed archive or image (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 case %f in *.tar.*) tar -taf %f;; *) ${P7ZIP} l %f;; esac + t t l List compressed archives or images (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do case %f in *.tar.*) tar -taf "$i";; *) ${P7ZIP} l "$i";; esac done + ! t t e Extract compressed archive or image (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 ${P7ZIP} x -bb3 -o$(dirname %f) %f + t t e Extract compressed archives or images (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do ${P7ZIP} x -bb3 -o"$(dirname "$i")" "$i" done + ! t t E Extract compressed archive or image to subdirs (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 id=`basename %f` iD="${id%.*}" mkdir -p "$iD" ${P7ZIP} x -bb3 -o"$iD" %f + t t E Extract compressed archives or images to subdirs (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do id=`basename "$i"` iD="${id%.*}" mkdir -p "$iD" ${P7ZIP} x -bb3 -o"$iD" "$i" done + f \.tar$ | f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.lzo$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.txz$ | f \.tar\.zst$ | f \.tzst$ | f \.tar\.Z$ | f \.tar\.bz2$ | f \.tbz2$ & t rl & ! t t x Extract the contents of a compressed tar file P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 unset PRG case %f in *.tar) PRG="";; *.tar.7z) PRG="${P7ZIP} e -so";; *.tar.bz2|*.tbz2) PRG="bunzip2 -c";; *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z) PRG="gzip -dc";; *.tar.lz) PRG="lzip -dc";; *.tar.lz4) PRG="lz4 -dc";; *.tar.lzma) PRG="lzma -dc";; *.tar.lzo) PRG="lzop -dc";; *.tar.xz|*.txz) PRG="xz -dc";; *.tar.zst|*.tzst) PRG="zstd -dc";; *) exit 1;; esac if [ -n "$PRG" ]; then $PRG %f | tar -xvf - else tar -xf %f fi + f \.tar$ | f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.lzo$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.txz$ | f \.tar\.zst$ | f \.tzst$ | f \.tar\.Z$ | f \.tar\.bz2 | f \.tbz2$ & t t x Extract the contents of compressed tagged tar files P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do unset PRG case "$i" in *.tar) PRG="";; *.tar.7z) PRG="${P7ZIP} e -so";; *.tar.bz2|*.tbz2) PRG="bunzip2 -c";; *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z) PRG="gzip -dc";; *.tar.lz) PRG="lzip -dc";; *.tar.lz4) PRG="lz4 -dc";; *.tar.lzma) PRG="lzma -dc";; *.tar.lzo) PRG="lzop -dc";; *.tar.xz|*.txz) PRG="xz -dc";; *.tar.zst|*.tzst) PRG="zstd -dc";; *) exit 1;; esac if [ -n "$PRG" ]; then $PRG "$i" | tar -xvf - else tar -xf "$i" fi done + f \.tar$ | f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.lzo$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.txz$ | f \.tar\.zst$ | f \.tzst$ | f \.tar\.Z$ | f \.tar\.bz2$ | f \.tbz2$ & t rl & ! t t X Extract the contents of a compressed tar file to subdir P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 unset D unset PRG case %f in *.tar) PRG=""; D=`basename %f .tar`;; *.tar.7z) PRG="${P7ZIP} e -so"; D=`basename %f .tar.7z`;; *.tar.bz2) PRG="bunzip2 -c"; D=`basename %f .tar.bz2`;; *.tbz2) PRG="bunzip2 -c"; D=`basename %f .tbz2`;; *.tar.gz) PRG="gzip -dc"; D=`basename %f .tar.gz`;; *.tar.z) PRG="gzip -dc"; D=`basename %f .tar.z`;; *.tgz) PRG="gzip -dc"; D=`basename %f .tgz`;; *.tpz) PRG="gzip -dc"; D=`basename %f .tpz`;; *.tar.Z) PRG="gzip -dc"; D=`basename %f .tar.Z`;; *.tar.lz) PRG="lzip -dc"; D=`basename %f .tar.lz`;; *.tar.lz4) PRG="lz4 -dc"; D=`basename %f .tar.lz4`;; *.tar.lzma) PRG="lzma -dc"; D=`basename %f .tar.lzma`;; *.tar.lzo) PRG="lzop -dc"; D=`basename %f .tar.lzo`;; *.tar.xz) PRG="xz -dc"; D=`basename %f .tar.xz`;; *.txz) PRG="xz -dc"; D=`basename %f .txz`;; *.tar.zst) PRG="zstd -dc"; D=`basename %f .tar.zst`;; *.tzst) PRG="zstd -dc"; D=`basename %f .tzst`;; *.tar.F) PRG="freeze -dc"; D=`basename %f .tar.F`;; *) echo "Unsupported compression,"; exit 255;; esac if [ -n "$PRG" ]; then mkdir "$D" && $PRG %f | tar -C "$D" -xvf - else mkdir "$D" && tar -C "$D" -xvf %f fi + f \.tar$ | f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lz4$ | f \.tar\.lzma$ | f \.tar\.lzo$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.txz$ | f \.tar\.zst$ | f \.tzst$ | f \.tar\.Z$ | f \.tar\.bz2$ | f \.tbz2$ & t t X Extract the contents of compressed tar files to subdir P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do unset D unset PRG case "$i" in *.tar) PRG=""; D=`basename $i .tar`;; *.tar.7z) PRG="${P7ZIP} e -so"; D=`basename $i .tar.7z`;; *.tar.bz2) PRG="bunzip2 -c"; D=`basename $i .tar.bz2`;; *.tbz2) PRG="bunzip2 -c"; D=`basename $i .tbz2`;; *.tar.gz) PRG="gzip -dc"; D=`basename $i .tar.gz`;; *.tar.z) PRG="gzip -dc"; D=`basename $i .tar.z`;; *.tgz) PRG="gzip -dc"; D=`basename $i .tgz`;; *.tpz) PRG="gzip -dc"; D=`basename $i .tpz`;; *.tar.Z) PRG="gzip -dc"; D=`basename $i .tar.Z`;; *.tar.lz) PRG="lzip -dc"; D=`basename $i .tar.lz`;; *.tar.lz4) PRG="lz4 -dc"; D=`basename $i .tar.lz4`;; *.tar.lzma) PRG="lzma -dc"; D=`basename $i .tar.lzma`;; *.tar.lzo) PRG="lzop -dc"; D=`basename $i .tar.lzo`;; *.tar.xz) PRG="xz -dc"; D=`basename $i .tar.xz`;; *.txz) PRG="xz -dc"; D=`basename $i .txz`;; *.tar.zst) PRG="zstd -dc"; D=`basename $i .tar.zst`;; *.tzst) PRG="zstd -dc"; D=`basename $i .tzst`;; *.tar.F) PRG="freeze -dc"; D=`basename $i .tar.F`;; *) echo "Unsupported compression,"; exit 255;; esac if [ -n "$PRG" ]; then mkdir "$D" && $PRG $i | tar -C "$D" -xvf - else mkdir "$D" && tar -C "$D" -xvf "$i" fi done + t r & ! t t z Compress or uncompress (gzip) current file unset DECOMP unset DEPROG case %f in *.gz|*.[zZ]) DEPROG=gzip; DECOMP=-d;; *) DEPROG=gzip; DECOMP="";; esac # Do *not* add quotes around $DECOMP! $DEPROG $DECOMP -v %f + t t z Compress or uncompress (gzip) tagged files for i in %t ; do unset DECOMP unset DEPROG case "$i" in *.gz|*.[zZ]) DEPROG=gzip; DECOMP=-d;; *) DEPROG=gzip; DECOMP="";; esac $DEPROG $DECOMP -v "$i" done + t r & ! t t Z Compress or uncompress (bzip2) current file unset DECOMP unset DEPROG case %f in *.bz2) DEPROG=bzip2; DECOMP=-d;; *) DEPROG=bzip2; DECOMP="";; esac # Do *not* add quotes around $DECOMP! $DEPROG $DECOMP -v %f + t t Z Compress or uncompress (bzip2) tagged files for i in %t ; do unset DECOMP unset DEPROG case "$i" in *.bz2) DEPROG=bzip2; DECOMP=-d;; *) DEPROG=bzip2; DECOMP="";; esac $DEPROG $DECOMP -v "$i" done + t r & ! t t y Compress or uncompress (zstd) current file unset DECOMP unset DEPROG case %f in *.zst) DEPROG=zstd; DECOMP="-d --rm";; *) DEPROG=zstd; DECOMP="--rm";; esac # Do *not* add quotes around $DECOMP! $DEPROG $DECOMP -v %f + t t y Compress or uncompress (zstd) tagged files for i in %t ; do unset DECOMP unset DEPROG case "$i" in *.zst) DEPROG=zstd; DECOMP="-d --rm";; *) DEPROG=zstd; DECOMP="--rm";; esac $DEPROG $DECOMP -v "$i" done + t r & ! t t u Compress or uncompress (xz) current file unset DECOMP unset DEPROG case %f in *.xz) DEPROG=xz; DECOMP=-d;; *) DEPROG=xz; DECOMP="";; esac # Do *not* add quotes around $DECOMP! $DEPROG $DECOMP -v %f + t t u Compress or uncompress (xz) tagged files for i in %t ; do unset DECOMP unset DEPROG case "$i" in *.xz) DEPROG=xz; DECOMP=-d;; *) DEPROG=xz; DECOMP="";; esac $DEPROG $DECOMP -v "$i" done + t r & ! t t U Compress (xz using 7z) or uncompress (any) current file P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 case %f in *.gz|*.[zZ]|*.bz2|*.xz|*.xz|*.7z|*.zst) ${P7ZIP} x %f && rm -vf %f;; *) ${P7ZIP} a -txz -m0=lzma2 -ms=on $COMPRESS_OPTS_7Z %f.xz %f && test -r %f.xz && rm -vf %f;; esac + t t U Compress (xz using 7z) or uncompress (any) tagged files P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do unset DECOMP case "$i" in *.gz|*.[zZ]|*.bz2|*.xz|*.xz|*.7z|*.zst) ${P7ZIP} x "$i" && rm -vf "$i";; *) ${P7ZIP} a -txz -m0=lzma2 -ms=on $COMPRESS_OPTS_7Z "$i.xz" "$i" && test -r "$i.xz" && rm -vf "$i";; esac done + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t c Convert gz<->bz2, tar.gz/tgz<->tar.bz2 current unset D unset EXT case %f in *.Z) EXT=Z;; *.bz2) EXT=bz2;; *.gz) EXT=gz;; *.tgz) EXT=tgz;; *.tpz) EXT=tpz;; *.z) EXT=z;; esac case "$EXT" in bz2|Z|gz|z) D="`basename %f ."$EXT"`";; tgz|tpz) D="`basename %f ."$EXT"`.tar";; esac if [ "$EXT" = "bz2" ]; then bunzip2 -v %f gzip -f9 -v "$D" else gunzip -v %f bzip2 -v "$D" fi + t t c Convert gz<->bz2, tar.gz/tgz<->tar.bz2 tagged files for i in %t ; do unset D unset EXT case "$i" in *.Z) EXT=Z;; *.bz2) EXT=bz2;; *.gz) EXT=gz;; *.tgz) EXT=tgz;; *.tpz) EXT=tpz;; *.z) EXT=z;; esac case "$EXT" in bz2|Z|gz|z) D=`basename "$i" ."$EXT"`;; tgz|tpz) D=`basename "$i" ."$EXT"`.tar;; esac if [ "$EXT" = "bz2" ]; then bunzip2 -v "$i" gzip -f9 -v "$D" else gunzip -v "$i" bzip2 -v "$D" fi done + ! t t j Convert any->xz (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 i=%f case "$i" in *.Z|*.bz2|*.gz|*.z|*.Z|*.bz2|*.tar.rar|*.tar.7z|*.zst) EXT=xz;; *.tgz|*.tbz2|*.tzst|*.tpz) EXT=tar.xz;; *) echo "Unsupported compression."; exit 255;; esac ${P7ZIP} e -so "$i" | ${P7ZIP} a -si -txz -m0=lzma2 -ms=on $COMPRESS_OPTS_7Z "${i%.*}.$EXT" && [ -s "${i%.*}.$EXT" ] && rm -vf "${i}" + t t j Convert any->xz (using 7z) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do case "$i" in *.Z|*.bz2|*.gz|*.z|*.Z|*.bz2|*.tar.rar|*.tar.7z|*.zst) EXT=xz;; *.tgz|*.tbz2|*.tzst|*.tpz|*.txz) EXT=tar.xz;; *) echo "Unsupported compression."; exit 255;; esac ${P7ZIP} e -so "$i" | ${P7ZIP} a -si -txz -m0=lzma2 -ms=on $COMPRESS_OPTS_7Z "${i%.*}.$EXT" && [ -s "${i%.*}.$EXT" ] && rm -vf "${i}" done + ! t t J Convert any->zst (using 7z and zstd) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 i=%f case "$i" in *.Z|*.bz2|*.gz|*.z|*.Z|*.bz2|*.tar.rar|*.tar.7z|*.xz) EXT=zst;; *.tgz|*.tbz2|*.tzst|*.tpz|*.txz) EXT=tar.zst;; *) echo "Unsupported compression."; exit 255;; esac ${P7ZIP} e -so "$i" | zstd $COMPRESS_OPTS_ZSTD - -o "${i%.*}.$EXT" && [ -s "${i%.*}.$EXT" ] && rm -vf "${i}" + t t J Convert any->zst (using 7z and zstd) P7ZIP=`command -v 7zz` || P7ZIP=`command -v 7z` || P7ZIP=`command -v 7za`; test -z "${P7ZIP}" && echo "7zip not found, aborting..." && exit 255 for i in %t ; do case "$i" in *.Z|*.bz2|*.gz|*.z|*.Z|*.bz2|*.tar.rar|*.tar.7z|*.xz) EXT=zst;; *.tgz|*.tbz2|*.tzst|*.tpz|*.txz) EXT=tar.zst;; *) echo "Unsupported compression."; exit 255;; esac ${P7ZIP} e -so "$i" | zstd $COMPRESS_OPTS_ZSTD - -o "${i%.*}.$EXT" && [ -s "${i%.*}.$EXT" ] && rm -vf "${i}" done + t t i Compare (mcdiff) tagged files or directories mcdiff %t + ! t t i Compare (mcdiff) opposite selected files if [ %d/%f = %D/%F ]; then echo "The two files must be different" exit 1 fi mcdiff %d/%f %D/%F + ! t t s Calculate SHA256 checksum of the current file SHACMD=`command -v sha256sum` || SHACMD="shasum -a256" $SHACMD %f + t t s Calculate SHA256 checksum of the tagged files for i in %t ; do SHACMD=`command -v sha256sum` || SHACMD="shasum -a256" $SHACMD "$i" done + ! t t S Calculate SHA512 checksum of the current file SHACMD=`command -v sha512sum` || SHACMD="shasum -a512" $SHACMD %f + t t S Calculate SHA512 checksum of the tagged files for i in %t ; do SHACMD=`command -v sha512sum` || SHACMD="shasum -a512" $SHACMD "$i" done