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

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

Closed
wizzup opened this issue Oct 19, 2019 · 3 comments
Closed

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

wizzup opened this issue Oct 19, 2019 · 3 comments
Labels

Comments

@wizzup
Copy link

wizzup commented Oct 19, 2019

$ 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
Copy link
Owner

schell commented Oct 19, 2019

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.

@schell schell added the bug label Oct 19, 2019
@mitchellwrosen
Copy link
Collaborator

@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
Copy link
Author

wizzup commented Oct 20, 2019

@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.

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

No branches or pull requests

3 participants