The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-21-2008
Llb Llb is offline
Registered User
  
 

Join Date: Nov 2008
Location: Bangalore,India
Posts: 13
Want to create 3 different new directories under the same path

Hi,
Iam new to UNIX...My requirement is to create 3 dir as an hierarchy under /var/opt/temip.The output should be /var/opt/temip/GP_Int/GPTTS/AUTO.
I have tried the following script...But only GP_int folder is getting created and not other folders...Can someone help???
#!/usr/bin/ksh
#script to create directory structure.
filename=/var/opt/temip
echo $filename
dirname=GP_Integration
echo $dirname

if [ -d $dirname ]
then
echo "directory exists already"
else
mkdir -p $(dirname $filename)
echo "directory GP_Integration created"

filename=/var/opt/temip/GP_Integration
echo $filename
dirname=GPTTS
echo $dirname
if [ -d $dirname ]
then
echo "directory exists already"
else
mkdir -p $(dirname $filename)
echo "directory GPTTS created"
fi

fi
Thanks...