LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Urgent- shell script to create sub folders (https://www.linuxquestions.org/questions/programming-9/urgent-shell-script-to-create-sub-folders-4175415769/)

chetan_linux 07-09-2012 04:16 PM

Urgent- shell script to create sub folders
 
Hi All,

Could any one help me with a shell script which will create different sub folders in a folder and of which the sub folders names should be taken from a text file.

Thanks

TobiSGD 07-09-2012 04:27 PM

This is not urgent for anyone of us, so please refrain from using words like urgent in your thread titles.
What have you done so far and what is not working exactly?

pixellany 07-09-2012 04:35 PM

Quote:

Originally Posted by chetan_linux (Post 4723270)
Hi All,

Could any one help me with a shell script which will create different sub folders in a folder and of which the sub folders names should be taken from a text file.

Thanks

Yep

Set up a loop to read from the file. Let's assume you read into a variable "newname" Each time thru the loop, issue the command "mkdir $newname".
As needed, go here and look up the "read" command, the "while" loop, and "redirection":
http://tldp.org/LDP/abs/html/index.html

(You can also get a PDF at the same site.)


All times are GMT -5. The time now is 03:05 PM.