summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2007-11-30 17:39:44 -0800
committerTom Grennan <tgrennan@vyatta.com>2007-11-30 17:39:44 -0800
commitedea63c7befc63550fdae6b9e0d1df3e4e0f5556 (patch)
tree78beee99a0ac1015387d2b2134b0cd6fb8ecd0c8 /scripts
parent4ba0963c02d51d11468becf0aa8020ed66de7361 (diff)
downloadvyatta-op-edea63c7befc63550fdae6b9e0d1df3e4e0f5556.tar.gz
vyatta-op-edea63c7befc63550fdae6b9e0d1df3e4e0f5556.zip
test for empty file list in "show log all"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-log-all4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/vyatta-show-log-all b/scripts/vyatta-show-log-all
index ceb439f..126b7fc 100755
--- a/scripts/vyatta-show-log-all
+++ b/scripts/vyatta-show-log-all
@@ -5,5 +5,5 @@ shopt -s extglob nullglob
declare -a zipped_files=($( printf "%s\n" /var/log/messages*.gz | sort -r ))
declare -a plain_files=($( printf "%s\n" /var/log/messages!(*.gz) | sort -r ))
-gunzip --stdout ${zipped_files[@]}
-cat ${plain_files[@]}
+[ ${#zipped_files[@]} -gt 0 ] && gunzip --stdout ${zipped_files[@]}
+[ ${#plain_files[@]} -gt 0 ] && cat ${plain_files[@]}