|
|
To remove an empty DOS directory, use the dosrmdir
command (see
doscmd(C)
for details), as follows:
dosrmdir directory
For example, to remove a directory called PROJECTS from the A: drive, type the following:
$ dosrmdir a:projectsBefore you remove a directory, you must make sure that it does not contain any files or subdirectories. If it is not empty, you must either delete the files it contains (using dosrm), or move them to other directories (using doscp to copy the files to a different directory, followed by dosrm to remove the files from the directory to be removed).
The following is a short script to remove all the files from a DOS directory:
#!/bin/sh for target in `dosls $1` do dosrm $1/${target} doneFor example, if the script is named dosdirempty, and your disk in drive A: contains a directory called work, you would type the following in order to remove all the contents of the work directory:
$ dosdirempty A:WORK