MV Command...

From: Jochen Cichon (jc@versainter.net)
Date: Wed Dec 13 2000 - 10:46:22 CET


Can u change the gateway so that MV is more user friendly...
for the new 11r3 :)

---- OLD

if [ -f "$1" ] ; then
        cp $1 $2
        rm -r $1
else
        echo "$1 is not a file. Use cp & rm."
fi

---- NEW

if [ -d "$1" ] ; then
        cp -r $1 $2 && rm -r $1
elif [ -f "$1" ] ; then

        cp $1 $2 && rm $1
else
        echo "$1 is not a file. Use cp & rm."
fi

----
So it now supports DIRECTORY moving and only REMOVE if copy has done it's job.
Maybe the last else is not required but pessimism.
Ciao Jochen...
---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk


This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:17 CET