Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
You can do this with just the array you havesimply loop over all values, no shifting needed:
folderArray=(sdb sdc sdd sde sdf sdg) for folder in "${folderArray[@]}"; do mkdir "/data/$folder" done
You can do this with just the array you have:
You can simply loop over all values, no shifting needed: