Timeline for Bash - Return value from subscript to parent script
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 22, 2022 at 16:49 | comment | added | user3091996 | @SaltukKezer you can use tail -1 to get the last line | |
Jan 24, 2022 at 21:43 | comment | added | Saltuk Kezer | @cdarke What if i just want the last line to be captured by the parent? | |
Jun 13, 2018 at 17:33 | history | edited | TRiG | CC BY-SA 4.0 |
The language type hints are a handy way to split out the two scripts.
|
Sep 13, 2016 at 7:48 | history | edited | cdarke | CC BY-SA 3.0 |
added 2 characters in body
|
May 22, 2015 at 7:48 | comment | added | cdarke |
@AakilFernandes: in this case, echo writes the line given to it: "some text value" in the example. However, the parent is capturing all the standard output from the child, whether it came from an echo or not. That could be multiple lines separated by newlines $'\n'
|
|
May 21, 2015 at 23:43 | comment | added | Akhil F | Does the echo method return everything echo'd by the child script or just the last line? | |
May 2, 2013 at 14:48 | vote | accept | user1049697 | ||
May 2, 2013 at 12:56 | history | answered | cdarke | CC BY-SA 3.0 |