-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
interp: consider some support for PIDs #221
Comments
This library is written in Go, so it can't spawn sub-processes. If I make I guess I could add it, but that behavior might confuse lots of people. I should add docs about these gotchas in the interpreter. |
Yea, printing |
How, exactly? The only portable and stable way to have multiple processes would be for the interpreter to run from a shell, say There's also the question of why you'd need $$ and $! in the first place. If you want to write portable shell scripts, how can you safely use them for anything other than printing them? All in all, I decided not to do it by default because it's too much hassle for little gain. However, I'm open to doing the option above - depending on its own shell executable - via an option like #171. There's always the option of using virtual PIDs, to make it so that $$ and $! could be different among goroutines. But I presume that will open a can of worms. |
Ping, @rhd? Did you have an implementation idea in mind? |
Timed out after a month - still open to suggestions, but I see no clear way forward right now. |
I'm not trying to reopen the issue, thought I can give you an answer regarding my current problem. I would like to parallel build multiple things, and if one of them fail, Therefore, without any indicator to point wait to, no return code can be gathered from a subshell. |
Thanks @Ckarles, that's a valid point. I'll reopen the issue for now. One way we could possibly do this is by having "virtual" PIDs by default, where each PID just maps to one of the goroutines running an interpreter's subshell. Then, we could still have We'd have to try to avoid conflicts between those per-goroutine PIDs and the real host system's PIDs, though. Maybe by making them start at a really big number, like 64k? |
Hi, I was playing around with go-task and I couldn't get this to work:
sleep 10 & echo $!
. It would only print a new line but not the PID of thesleep
call. @andreynering suggested I post an issue here.Any suggestions?
Thanks!
The text was updated successfully, but these errors were encountered: