2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 405
/ 1 Year ago, thu, december 29, 2022, 9:15:37
I run the following command in a bash script:
cd SomeDir && (sh -c "$CMD_STR") 2>&1 | some_filtering | sed -u -e ....
I.e. I run CMD_STR in SomeDir (actually CMD_STR is 'make' or 'make target'), do some filtering on CMD_STR's output and then replace some symbols by 'sed'.
I need to retrieve CMD_STR's status code in case CMD_STR fails to return it from my script. How can I do it?
More From » scripts