schell / steeloverseer

A file watcher and development tool.
BSD 3-Clause "New" or "Revised" License
128 stars 14 forks source link

/bin/sh: -c: line 0: syntax error near unexpected token `(' #39

Closed wizzup closed 4 years ago

wizzup commented 4 years ago
$ g++ 000.cpp && diff output.txt <(./a.out < input.txt)
1c1
< 9
\ No newline at end of file
---
> Hello

$ sos -p 000.cpp -c "g++ 000.cpp && diff output.txt <(./a.out < input.txt)"
Hit Ctrl+C to quit.

Modified: 000.cpp
[1/1] g++ 000.cpp && diff output.txt <(./a.out < input.txt)
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `g++ 000.cpp && diff output.txt <(./a.out < input.txt)'
Failure ✗ (1)
schell commented 4 years ago

Thanks for the bug! I think it's possible your parenthesis are being interpreted as a capture group? I'm not sure. I'll get to this as soon as I can.

mitchellwrosen commented 4 years ago

@wizzup I think this syntax is a bashism, but sos runs shell commands with sh. Do you get the same error with this at the shell?

$ sh -c 'g++ 000.cpp && diff output.txt <(./a.out < input.txt)'
wizzup commented 4 years ago

@mitchellwrosen Good catch! Got the same error when running with sh.

I don't think sos need to do anything with bash. I am going to close this as won't fix.

My workaround is just create a run.sh and call it instead.