0

I want to create a folder following the below procedure:

set folder 2017/October/10
mkdir $folder

But this isn't possible and I get the message:

mkdir: cannot create directory '2017/October/10': No such file or directory

I want to include that in script function! I could really use some help!

EDIT: This just can't happen!

muru
  • 207,228
Teo Protoulis
  • 305
  • 1
  • 5
  • 16

1 Answers1

3

The / character is used to separate the different directories, and it fails because the directory 2017 does not yet exist. To create nested directories with the parent directories created automatically, use

mkdir -p 2017/October/10
rlee827
  • 177