X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Flistarch.sh;h=972295c01bb06d57310780333afd191eb8905c52;hb=5c64fed4da502a3215826604d7e8a6b3e6b91e2b;hp=88cc9678820f27857bcf1bde600aaf2b63de3495;hpb=37ad93186a66429fde4b05bb25cd1f6beb757241;p=feisty_meow.git diff --git a/scripts/archival/listarch.sh b/scripts/archival/listarch.sh index 88cc9678..972295c0 100644 --- a/scripts/archival/listarch.sh +++ b/scripts/archival/listarch.sh @@ -24,6 +24,16 @@ if [ ! -f "$archive_file" ]; then exit 1 fi +if [ -z "$PAGER" ]; then + PAGER=$(which less) + if [ -z "$PAGER" ]; then + PAGER=$(which more) + if [ -z "$PAGER" ]; then + PAGER="cat" + fi + fi +fi + # save where we started out. ORIGINATING_FOLDER="$( \pwd )" @@ -44,13 +54,14 @@ if [[ $archive_file =~ .*\.tar$ \ || $archive_file =~ .*\.oar$ \ || $archive_file =~ .*\.tgz$ \ || $archive_file =~ .*\.ova$ \ + || $archive_file =~ .*\.snarf$ \ ]]; then - tar -tf $archive_file + tar -tf $archive_file | $PAGER elif [[ $archive_file =~ .*\.zip$ \ || $archive_file =~ .*\.epub$ \ || $archive_file =~ .*\.odt$ \ || $archive_file =~ .*\.jar$ \ || $archive_file =~ .*\.war$ \ ]]; then - unzip -v $archive_file + unzip -v $archive_file | $PAGER fi