Home » Infrastructure » Unix » unix shell script (bash)
unix shell script [message #399255] Tue, 21 April 2009 05:40 Go to next message
vamsikrishnag
Messages: 16
Registered: October 2008
Junior Member
Hi,

I have the following text file:

/KING
/KING/JONES
/KING/JONES/SCOTT
/KING/JONES/SCOTT/ADAMS
/KING/JONES/FORD
/KING/JONES/FORD/SMITH
/KING/BLAKE
/KING/BLAKE/ALLEN
/KING/BLAKE/WARD
/KING/BLAKE/MARTIN
/KING/BLAKE/TURNER
/KING/BLAKE/JAMES
/KING/CLARK

/KING/CLARK/MILLER

I would like to create the directory structure as mentioned above.
Assume that i am currently in GVK. all the directories should come under this directory.
Also i would like to avoid rows that are having spaces.

I have the following script.

while read file
do
if [ ! -d `$file` ] ; then
mkdir -p $file
fi ;
done < path.txt

Please suggest if any changes needs to be done or please send me the code.

Regards,
G.Vamsi Krishna
Re: unix shell script [message #399259 is a reply to message #399255] Tue, 21 April 2009 05:52 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This question bears no connection with Oracle.
Please find a more appropriate forum.
The topic is locked.

Regards
Michel
Previous Topic: Unable to start EM on Solaris 10 Oracle db 10.2
Next Topic: UNIX script to check archivelog backup
Goto Forum:
  


Current Time: Tue Dec 17 19:57:40 CST 2024