first complete prorgram with copy and move functionality working
1 parent c8280a2 commit 25ad65491a0936d3117847affe2e43b487929479
@tundra tundra authored on 25 Oct 2016
Showing 1 changed file
View
10
trm.sh
 
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