mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-30 08:51:06 +00:00
37 lines
820 B
Plaintext
37 lines
820 B
Plaintext
|
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
|