X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Flistarch.sh;h=c21d5d689a07669bfafc6c6bf15b2a7bbaae3e42;hb=359e2d0985e617ad6de421bda835baf621523d97;hp=6c621611897a8277241d5dc728d4a21e2fc8f4a9;hpb=da12bc4babc06a03a41ef75626fd47e2d2891048;p=feisty_meow.git diff --git a/scripts/archival/listarch.sh b/scripts/archival/listarch.sh index 6c621611..c21d5d68 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,14 @@ if [[ $archive_file =~ .*\.tar$ \ || $archive_file =~ .*\.iar$ \ || $archive_file =~ .*\.oar$ \ || $archive_file =~ .*\.tgz$ \ + || $archive_file =~ .*\.ova$ \ ]]; 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