I would like to translate this Linux/Bash script to Windows shell:
if test -d myDirName; then echo "ok"; else mkdir myDirName; fi
It tests if a directory exists, and if it doesn't it creates it.
|
I would like to translate this Linux/Bash script to Windows shell:
It tests if a directory exists, and if it doesn't it creates it. |
||||
|
|||||||||
|
|
Use a backslash, not forward slash:
-- foo is a directory |
||||
|
|
also is true if myDirName is a file, whis is not the searched functionality |
|||
|
|
|
Here is what I just found out: You can test if a nul file exists; if the directory exists it will contain a nul file, if the nul file does not exist then the directory does not exist.
|
|||||||
|
mkdir -p myDirName. After spending days trying to translate relatively simple bash-scripts into batch-sh*t (assigning the result of a function to a variable?), I've decided to just make people install cygwin. – michael_n Mar 30 at 11:00