X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Flistarch.sh;h=972295c01bb06d57310780333afd191eb8905c52;hb=5c64fed4da502a3215826604d7e8a6b3e6b91e2b;hp=6c621611897a8277241d5dc728d4a21e2fc8f4a9;hpb=da12bc4babc06a03a41ef75626fd47e2d2891048;p=feisty_meow.git diff --git a/scripts/archival/listarch.sh b/scripts/archival/listarch.sh index 6c621611..972295c0 100644 --- a/scripts/archival/listarch.sh +++ b/scripts/archival/listarch.sh @@ -20,10 +20,20 @@ if [ -z "$archive_file" ]; then exit 1 fi if [ ! -f "$archive_file" ]; then - echo "The file specified for listing cannot be located: $archive_file" + echo "The file specified cannot be located: $archive_file" 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 )" @@ -43,13 +53,15 @@ if [[ $archive_file =~ .*\.tar$ \ || $archive_file =~ .*\.iar$ \ || $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