|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
directory
Hi,
Please help me on this script exercises. Create script that will determine if the directory exists, if not the script will create the directory. Take note: The script should be able to determine nested directory and will be able to create it if it does not exists. For example: /home/admin/log/2004/july/receipts Challenge: from directory 2004, then july, then receipts, all are not yet existing Thanks in advance |
|
#2
|
|||
|
|||
|
Code:
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Example Usage : ./test.sh /home/admin/log/2004/july/receipts"
return
fi
if [ ! -d $1 ]
then
mkdir -p $1
else
echo "Directory already exists: "$1
fi
HTH |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|