Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k
added 10 characters in body
Source Link

I was just wondering whether or not this script code would properly test for the existence of a directorydir2, and if it doesn't exist, then to create it. ThanxDir1 already exists.

[ ! -d /dir1/dir2  ] && mkdir /dir1/dir2

I was just wondering whether or not this script code would properly test for the existence of a directory, and if it doesn't exist, then to create it. Thanx

[ ! -d /dir1/dir2  ] && mkdir /dir1/dir2

I was just wondering whether or not this script code would properly test for the existence of a dir2, and if it doesn't exist, then to create it. Dir1 already exists.

[ ! -d /dir1/dir2  ] && mkdir /dir1/dir2
Minor: Fix spelling, format code.
Source Link
John1024
  • 76.4k
  • 12
  • 176
  • 165

I was just wondering whether or not this sciptscript code would properly test for the existence of a directory, and if it doesn't exist, then to create it. Thanx

[ ! -d /dir1/dir2 ] && mkdir /dir1/dir2

[ ! -d /dir1/dir2  ] && mkdir /dir1/dir2

I was just wondering whether or not this scipt code would properly test for the existence of a directory, and if it doesn't exist, then to create it. Thanx

[ ! -d /dir1/dir2 ] && mkdir /dir1/dir2

I was just wondering whether or not this script code would properly test for the existence of a directory, and if it doesn't exist, then to create it. Thanx

[ ! -d /dir1/dir2  ] && mkdir /dir1/dir2
Source Link
Loading