5

Mostly curiosity: how to make "mkdir {1..$number}" work from a script?

view full story
linux-howto

http://www.linuxforums.org – I'll make up some (probably ugly) alternative just to have the script working, but I'd like to ask how it could be done more directly anyway. If that's actually possible, which I'm starting to suspect that is not the case. What I've tried so far: mkdir {1..$numdirs} mkdir {1.."$numdirs"} mkdir "{1.."$numdirs"}" mkdir '{1..'$numdirs'}' mkdir \{1..$numdirs\} mkdir \{1.."$numdirs"\} mkdir {1..$(echo $numdirs)} mkdir {1..$(echo ${numdirs})} mkdir {1..${numdirs}} trick="{1..$numdirs}" mkdir $trick The same result for all, folders literally called "{1..5}" or whatever is the number assigned to the variable. (HowTos)