diff options
author | Tom Grennan <tgrennan@vyatta.com> | 2007-11-30 17:39:44 -0800 |
---|---|---|
committer | Tom Grennan <tgrennan@vyatta.com> | 2007-11-30 17:39:44 -0800 |
commit | edea63c7befc63550fdae6b9e0d1df3e4e0f5556 (patch) | |
tree | 78beee99a0ac1015387d2b2134b0cd6fb8ecd0c8 /scripts | |
parent | 4ba0963c02d51d11468becf0aa8020ed66de7361 (diff) | |
download | vyatta-op-edea63c7befc63550fdae6b9e0d1df3e4e0f5556.tar.gz vyatta-op-edea63c7befc63550fdae6b9e0d1df3e4e0f5556.zip |
test for empty file list in "show log all"
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-log-all | 4 |
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[@]} |