From 96ebf8ed54b7af33a9088c8c6c92932974f3992d Mon Sep 17 00:00:00 2001 From: Tommy Reynolds Date: Fri, 27 Jan 2006 23:15:56 +0000 Subject: Append commands to the log file "/tmp/fdpsh.log" if, and only if, it already exists. --- bin/fdpsh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/fdpsh b/bin/fdpsh index ca682bf..f4baef2 100755 --- a/bin/fdpsh +++ b/bin/fdpsh @@ -18,6 +18,8 @@ PATH=${FDPBINDIR}:${PATH} export PATH FDPDIR=${FDPBINDIR}/../.. export FDPDIR SHELL=${FDPBINDIR}/${ME} export SHELL # +FDPLOG=/tmp/fdpsh.log +# . ${FDPBINDIR}/fdp-functions # CMD= @@ -29,9 +31,11 @@ do esac done if [ "${CMD}" ]; then + [ ! -f ${FDPLOG} ] || echo "${CMD}" >>${FDPLOG} eval ${CMD} results=$? elif [ $# -gt 0 ]; then + [ ! -f ${FDPLOG} ] || echo "${CMD}" >>${FDPLOG} eval $@ results=$? else @@ -40,6 +44,7 @@ else echo -n "${ME}> " >&2 read -e cmd if [ "${cmd}" ]; then + [ ! -f ${FDPLOG} ] || echo "${CMD}" >>${FDPLOG} eval ${cmd} results=$? if [ ${results} -gt 0 ]; then -- cgit