A2osX/EXAMPLES/MVDIR.txt

37 lines
820 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# This utility moves an entire directory sctructure from
# one place to another. The source must be a directory and
# and the destination must not already exist.
#
# Examples: MVDIR PATRICK HOME/PATRICK will move the
# subdirectory PATRICK and all the files and dirs in it to the
# new location of HOME/PATRICK, HOME having to exist but HOME/PATRICK not.
#
#!/BIN/SH
IF [ -D $1 ]
ELSE
ECHO "Invalid Source Directory - Aborting"
EXIT
FI
IF [ -E $2 ]
ECHO "Destination Already Exists - Aborting"
EXIT
FI
MD $2
IF [ -D $2 ]
ELSE
ECHO "SOMETHING IS WRONG, COULD NOT CREATE DESTINATION"
EXIT
FI
ECHO "Moving Files...."
MV -Q -R "${1}/*" "${2}"
RM -Q -R $1
RD $1
ECHO "Finished"
MAN
TEXT /MAKE/USR/SHARE/EXAMPLES/MVDIR