Article 4WNT0 FOR loop

FOR loop

by
gilesaj001
from LinuxQuestions.org on (#4WNT0)
I want to create multiple folders using the for loop and I have been trying to figure it out now for a while and can't seem to get the right syntax. I want to create multiple folders in the folder i run the script in called BOINC_100 BOINC_101 BOINC_102 etc I have tried a lot of things and the only one I have gotten to run is as follows:

Code:#!/bin/bash
for x in {100..1..101}
do
mkdir "BOINC_$x"
doneBut instead of creating multiple folders it just creates one folder called BOINC_{100..101..1}

If I try for $x in {100..1..101} I get this error Syntax error: Bad for loop variable

If I try for x in [100..1..101]

I get a folder called 'BOINC_[100..1..101]'

Cheers.latest?d=yIl2AUoC8zA latest?i=9iWIjmOK4IE:puD3aCMTPFQ:F7zBnMy latest?i=9iWIjmOK4IE:puD3aCMTPFQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=9iWIjmOK4IE:puD3aCMTPFQ:gIN9vFw9iWIjmOK4IE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments