create directory

How can I create directory? I have a 200 directory that i want to create. All of directory name that I want to create is in the file name "list".
Please help
teeraAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MysidiaCommented:
mkdir (dirname)


What does "list" look like?

if it's a list of just directory names one per line, you could use something like

cat list |xargs mkdir

to make your directories
teeraAuthor Commented:
it show    
xargs: un match single qouat

List file is like this

Aloha Resort & Spa
Al's Hut Bungalow
Al's Resort
Amadeus Bungalow
Amari Palm Reef Resort
Amity Bungalow
Anchor House Bungalow
Anong Villa
Ar-An Resort
Arayaburi Boutique Resort
Aree Bungalow
Ark Bar Garden Beach Resort
Axolotl Village
Baan Chaweng Resort
Baan Haad Ngam Boutique Resort & Spa
sunnycoderCommented:
The error might be due to the single ' in Al's

You need to preprocess the file to escape all ' with a \

sed "s/'/\\\'/" name > name.new
MysidiaCommented:
Special characters in the directory names like space and '  (single quote,
or apostrophe) throw it off and need to be escaped.

try  starting with:

cat list |sed "s/ /\\ /g;  s/'/\\'/g" |xargs mkdir

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
byttaCommented:
just use quotes or  around each line - it covers everything (except quotes and $,! )...

to modify Mysidia's version (^and $ are start/end of each line):
cat ../list |sed -e  "s/^/\"/g;s/$/\"/g" | xargs mkdir  

to escape quotes too:
cat ../list |sed -e  "s/\"/\\\"/g; s/^/\"/g;s/$/\"/g"  | xargs mkdir  
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.