How do I use mkdir{bin,usr,etc} in a script
Hi when I try to use the following code in bash
mkdir{bin,usr,etc} I am left with a folder that is literally named: {bin,usr,etc} instead of 3 different folders. Any ideas? |
Works just fine for me:
Code:
$ cat test.sh |
would be nice to see what did you execute - exactly.
Is this your homework? |
Your script is being run by Dash.
Dash does not expand {bin,usr,etc} like Bash does. I am guessing that you are using a distro that links /bin/sh to dash. You need to specify #!/bin/bash on the first line. Ed |
Quote:
mkdir "{bin,usr,etc}" And let us know what Shell you use |
Brace expansion can be enabled/disabled with set command, e.g.:
Code:
$ set -B; printf "'%s'\n" {a1,b2,c3} |
Quote:
Code:
|
Quote:
But the following: Code:
mkdir bin usr etc |
Quote:
|
All times are GMT -5. The time now is 09:46 PM. |