From: Chris Koeritz Date: Wed, 3 Oct 2012 20:29:01 +0000 (-0400) Subject: added pager at end, so we don't have to always combine the listing with less. X-Git-Tag: 2.140.90~1202 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=eba64f5df86749398e90289ed4d0400131e65815;p=feisty_meow.git added pager at end, so we don't have to always combine the listing with less. --- diff --git a/scripts/archival/listarch.sh b/scripts/archival/listarch.sh index 88cc9678..c21d5d68 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 )" @@ -45,12 +55,12 @@ if [[ $archive_file =~ .*\.tar$ \ || $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