process
process copied to clipboard
unexpected result for creating directory tree using callProcess or callCommand
shell command :-
mkdir -p ./{new/{new1,new2},old}
tested with :-
callProcess "mkdir" ["-p" , "./{new/{new1,new2},old}"] callCommand "mkdir -p ./{new/{new1,new2},old}"
result :-
. ├── {new │ └── {new1,new1},old}
expected output :-
tree . . ├── new │ ├── new1 │ └── new1 └── old
I printed shell command with :- showCommandForUser "mkdir" ["-p" , "./{new/{new1,new2},old}"]
output :- "mkdir -p './{new/{new1,new2},old}'"
this single single quotes around directory name causing problem how can i fix this
The {} syntax is brace expansion from bash (https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Brace-Expansion). You will need to run your expression through bash to get the behavior you are after.