![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check if all directories of file's path exists? | MartyIX | Shell Programming and Scripting | 2 | 08-19-2008 03:31 PM |
| Find a file in sub-directories.. o/p just the path | pranavagarwal | Shell Programming and Scripting | 3 | 11-23-2007 01:50 AM |
| Bash Script to display directories in Path? | debut | Shell Programming and Scripting | 1 | 11-09-2005 05:06 PM |
| How to create directories | abishekmag | UNIX for Dummies Questions & Answers | 3 | 03-21-2005 01:34 PM |
| How do I create & Maintain directories | kimjones142001 | UNIX for Dummies Questions & Answers | 4 | 09-10-2001 05:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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... |
|
||||
|
First of all, just "mkdir -p /var/opt/temip/GP_Int/GPTTS/AUTO" should work. The -p switch will suppress errors if the dirs exist and create the parents.
Reply if you need more help. You confused me a bit with "filename" and "dirname" by using a directory as filename... |
| Sponsored Links | ||
|
|