diff options
author | Jonas Smedegaard <dr@jones.dk> | 2007-09-27 21:46:27 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2007-09-27 21:46:27 +0000 |
commit | 281e16d08017c63987007c0d211dc0a37c5b2e56 (patch) | |
tree | 8c34d65615ef2f07dec0e8be92764a9fb646e32e /showlog | |
parent | 6e3c734e05959e2865d8ebce78735e1ce00ef6a3 (diff) |
Allow tail_history to be overridden on commandline.
Diffstat (limited to 'showlog')
-rwxr-xr-x | showlog | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3,7 +3,7 @@ # /usr/local/sbin/showlog # Copyright 2002-2006 Jonas Smedegaard <dr@jones.dk> # -# $Id: showlog,v 1.10 2006-10-27 22:02:22 jonas Exp $ +# $Id: showlog,v 1.11 2007-09-27 21:46:27 jonas Exp $ # # Show topic-specific log entries # @@ -43,7 +43,7 @@ cat_logs() { done } -tail_history="50" +tail_history="$(tail_history:-500)" target=$1 shift || exit1 "Missing argument" @@ -100,9 +100,9 @@ if [ $# -gt 0 ]; then for keyword in $@; do grep_opts="$opts -e $keyword" done - cat_logs "$logroot" "$logpattern" | grep -i $grep_opts | tail -n $tail_history + cat_logs "$logroot" "$logpattern" 7 | grep -i $grep_opts | tail -n $tail_history # [ -f $logroot/$log ] && tail -n 0 -F $logroot/$log | grep -i $grep_opts else - cat_logs "$logroot" "$logpattern" | tail -n $tail_history + cat_logs "$logroot" "$logpattern" 7 | tail -n $tail_history # [ -f $logroot/$log ] && tail -n 0 -F $logroot/$log fi |