LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-09-2012, 04:16 PM   #1
chetan_linux
Member
 
Registered: Aug 2008
Posts: 61

Rep: Reputation: 1
Question 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
 
Old 07-09-2012, 04:27 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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?
 
Old 07-09-2012, 04:35 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by chetan_linux View Post
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.)
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script Compare Folders corteplaneta Programming 8 09-18-2010 01:32 AM
bash script to create folders including making recursive folders.... linux-bandit Linux - Software 8 11-28-2009 01:50 AM
Script to create folders recurssively Tekken Linux - Server 20 08-22-2009 10:15 AM
Script to create folders and subfolders leupi Linux - Newbie 12 07-18-2008 10:39 AM
Cannot create folders with bash script called from php keyF Linux - Software 4 06-25-2006 10:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration