Timeline for Collect exit codes of parallel background processes (sub shells)
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 12, 2018 at 16:15 | comment | added | Alexander Mills | nice yep seems like you are correct | |
| Apr 12, 2018 at 15:51 | comment | added | arberg | I tested with "${1}" and it doesn't work. I'm passing an array to the function, and apparently that needs special attention in bash. $! is the pid of the last spawned job, see tldp.org/LDP/abs/html/internalvariables.html It seems to work correctly in my tests, and I'm now using in the in unRAID cache_dirs script, and it seems to do its job. I'm using bash 4.4.12. | |
| Apr 12, 2018 at 15:48 | history | edited | arberg | CC BY-SA 3.0 |
fixed childen -> children
|
| Apr 11, 2018 at 12:40 | comment | added | Alexander Mills |
the only concern I have with this script, is if children_pids+=("$!") is actually capturing the desired pid for the sub shell.
|
|
| Apr 11, 2018 at 12:33 | vote | accept | Alexander Mills | ||
| Apr 11, 2018 at 12:31 | comment | added | Alexander Mills |
cool, I think for job in "${childen[@]}"; do should be for job in "${1}"; do though, for clarity
|
|
| Apr 11, 2018 at 7:18 | history | edited | arberg | CC BY-SA 3.0 |
better code
|
| Apr 11, 2018 at 7:07 | review | First posts | |||
| Apr 11, 2018 at 7:42 | |||||
| Apr 11, 2018 at 7:06 | history | answered | arberg | CC BY-SA 3.0 |