diff --git a/trm.sh b/trm.sh index d743bbe..aaa8ae2 100755 --- a/trm.sh +++ b/trm.sh @@ -58,21 +58,21 @@ shift $((OPTIND-1)) for arg in $* do - real=$(readlink -f $arg) - SRCDIR=$(dirname $real) - SRCFIL=$(basename $real) + REALPATH=$(readlink -f $arg) + SRCDIR=$(dirname $REALPATH) + SRCFIL=$(basename $REALPATH) DESDIR=${GRAVEYARD}${SRCDIR} SERIAL=$(date +%Y%m%d%s%N) DESFIL="${SRCFIL}.${SERIAL}" - CMD="${OPERATOR} $VERBOSE '${SRCFIL}' '${DESDIR}/${DESFIL}'" + CMD="${OPERATOR} $VERBOSE '${REALPATH}' '${DESDIR}/${DESFIL}'" if [ -n "${TESTMODE}" ] then echo ${CMD} else mkdir -p ${DESDIR} - echo ${CMD} + eval ${CMD} fi done