Advertisement Jump to content
Sign in to follow this  
TheComet

[Bash] Iterate through alphabet not working?

This topic is 1770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have the need to generate 26 folders on a linux system, one for each letter of the alphabet. I tried the following:

for x in {a..z}
do
    mkdir $x
done

Interestingly, this created only one folder with the name "{a..z}" instead of the expected 26 folders.

 

I looked on google, but it seems no one else is having this issue, and the code above is what everyone else is doing to generate their 26 folders. What's going on?

Share this post


Link to post
Share on other sites
Advertisement

... and if you're not starting with any hash-bang, it will default to using sh instead of bash, so you still won't get bashisms.

Edited by Bregma

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!