Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected result for creating directory tree using callProcess or callCommand #259

Open
pucsdian opened this issue Aug 19, 2022 · 1 comment

Comments

@pucsdian
Copy link

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

@joehealy
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants