1

How can I ensure that intermidiate components exist? Something like mkdir -p {} but without last component?

ArekBulski
  • 4,520
  • 4
  • 39
  • 61
  • Why don't you just do mkdir -p without the last component? Where are you getting your directory structure from? – 123 Apr 16 '17 at 17:00

1 Answers1

2

Let's say your path is $f

Just run mkdir -p `dirname $f`

ArekBulski
  • 4,520
  • 4
  • 39
  • 61
beeselmane
  • 1,111
  • 8
  • 26