From fef686b449f89041312868ba8c4629d3b4a72601 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 13 Jun 2008 11:28:43 +0200 Subject: [PATCH] remove basename - use standard vars defined in cconf Signed-off-by: Nico Schottelius --- ccollect.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index d0c272e..2856df3 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -20,6 +20,13 @@ # Initially written for SyGroup (www.sygroup.ch) # Date: Mon Nov 14 11:45:11 CET 2005 +# +# Standard variables (stolen from cconf) +# +__pwd="$(pwd -P)" +__mydir="${0%/*}"; __abs_mydir="$(cd "$__mydir" && pwd -P)" +__myname=${0##*/}; __abs_myname="$__abs_mydir/$__myname" + # # where to find our configuration and temporary file # @@ -29,7 +36,7 @@ CDEFAULTS=${CCOLLECT_CONF}/defaults CPREEXEC="${CDEFAULTS}/pre_exec" CPOSTEXEC="${CDEFAULTS}/post_exec" -TMP=$(mktemp "/tmp/$(basename $0).XXXXXX") +TMP=$(mktemp "/tmp/${__myname}.XXXXXX") VERSION=0.7.1 RELEASE="2008-04-XX" HALF_VERSION="ccollect ${VERSION}" @@ -98,7 +105,7 @@ display_version() # usage() { - echo "$(basename $0): [args] " + echo "${__myname}: [args] " echo "" echo " ccollect creates (pseudo) incremental backups" echo ""