From 281e16d08017c63987007c0d211dc0a37c5b2e56 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 27 Sep 2007 21:46:27 +0000 Subject: Allow tail_history to be overridden on commandline. --- showlog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'showlog') diff --git a/showlog b/showlog index aeceb94..7d78e3d 100755 --- a/showlog +++ b/showlog @@ -3,7 +3,7 @@ # /usr/local/sbin/showlog # Copyright 2002-2006 Jonas Smedegaard # -# $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 -- cgit v1.2.3