From d3b2f6fcf263f0a460ab5e0083f0eac9742a0626 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 15 Mar 2011 13:39:58 +0100 Subject: Fix bashisms: superfluous leading function keyword. Thanks to 'themill'. --- localcowbuilder-login | 2 +- localcowbuilder-update | 2 +- localcowdebuild | 2 +- localgitcowdebuild | 2 +- localgitdebuild | 2 +- localgitpdebuild | 2 +- localpbuilder-login | 2 +- localpbuilder-update | 2 +- localpdebuild | 2 +- localwebresolve | 14 +++++++------- xsh | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/localcowbuilder-login b/localcowbuilder-login index f1cedb3..c3f9289 100755 --- a/localcowbuilder-login +++ b/localcowbuilder-login @@ -24,7 +24,7 @@ set -e PRG=$(basename "$0") -function showhelp() { +showhelp() { cat < [ [...]]" echo " If no website is given, all are attempted" exit 1 } -function exit1() { +exit1() { echo "Error: $1" echo "Exiting..." exit 1 @@ -43,11 +43,11 @@ LOGROOT=/var/log/apache-vhosts WEBROOT=/var/www # Options: $1=LOGROOT, $2=WEBROOT, $3=WEBSITE, $4=YEARDOTMONTH -function resolveddir() { echo $1/$3; } -function webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; } -#function logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); } -function logcontent() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; } -function logremove() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; } +resolveddir() { echo $1/$3; } +webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; } +#logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); } +logcontent() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; } +logremove() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; } # The above can be overridden LOCALCONFIG=/etc/local/webresolve.conf diff --git a/xsh b/xsh index 8a13134..d6273d4 100755 --- a/xsh +++ b/xsh @@ -2,11 +2,11 @@ SCRIPT=$(basename $0) -function usage () { +usage() { echo "Usage: $SCRIPT [--x] [--verbose] [[--su |{user}@]{host}] [--] [remote command...]" } -function termwrapper () { +termwrapper() { PRG=$@ titletext="$title $titleopt" if [ "$V" = 1 ]; then -- cgit v1.2.3