Bash expansion

Hi,
is there an easier way to mkdir {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}0
THanks
Steven
LVL 1
steviedeehookAsked:
Who is Participating?
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.

sunnycoderCommented:
Hi steviedeehook,

i=0
while [ $i -lt 16 ]
do
       mkdir $i
       i=` expr $i + 1`
done

Cheers!
sunnycoder
steviedeehookAuthor Commented:
Could you explain that to me a lil?
you set var i to = 0, then each time you create a dir you increase i by 1
what's lt?
what's expr?
What I actually need would be:
i=0; while [ $i -lt 160 ]; do mkdir $i; i=` expr $i + 10`; done; rm -r 0
:-) it's not much shorter, but it'll help when there are more than 15 to create.
Thanks
Steven
sunnycoderCommented:
Initialization
i=0

while [ $i -lt 16 ] while i is less than 16
do
       mkdir $i   creatre directory with the same name as value of i
       i=` expr $i + 1`    increment i by 1 ...
done

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
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

sunnycoderCommented:
Did you need any further clarifications?

please take time to read the grading guidelines here
http://www.experts-exchange.com/help.jsp#hi73
steviedeehookAuthor Commented:
no, sorry, I guess I should have graded u as A,
Just that the answer you gave wasn't totally corrrect, It didn't do what I was looking for and I had to edit it.
But it was the fastest and best service I've had here.
sorry, and thanks
Steven
sunnycoderCommented:
>Just that the answer you gave wasn't totally corrrect, It didn't do what I was looking for and I had to edit it.
In that case you should post back seeking clarifications unless the edit was too trivial.

I thought the script I gave did actually do what you asked for in the original question ... Out of curiosity what was missing?

Moderators can update the grades. Would you be agreeable to updating the grade to A if I were to post a request in CS?
steviedeehookAuthor Commented:
Yea you can upgrade it to an A.
i=0
while [ $i -lt 160 ]
do mkdir $i
i=` expr $i + 10`
done
rm -r 0
does what I was lookin for
I think you didn't see the 0 at the end of my first command "mkdir {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}0"
Steven.
sunnycoderCommented:
thanks :) .. You are right ... I missed the 0
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.