Skip to main content
2 of 4
Always quote your variables, especially when using paths
MatthewRock
  • 7.2k
  • 7
  • 35
  • 55

You can use backticks to store the result of a command (in my example, it's uname) on a variable, then echo it onscreen, and eventually use it as argument to mkdir:

FOO=`uname -n`
echo "$FOO"
mkdir "$FOO" 
dr_
  • 32.4k
  • 22
  • 102
  • 147