victor9309 commented on PR #683:
URL: https://github.com/apache/flink-web/pull/683#issuecomment-1778542189
Thanks @XComp for the review. Thank you very much for your advice.
```
$ cat foo-utils.sh
function foo() {
echo 'foo...........' >&2
exit 1
}
$ cat foo-main.sh
source ./foo-utils.sh
v=$(foo)
echo "$v"
echo "end-------------"
```

I found that exit 1 in the function can not exit the script, so I modify the
logic, please check it
```
$ cat foo-utils.sh
export TOP_PID=$$
trap 'exit 1' TERM
function foo() {
echo 'foo...........' >&2
kill -s TERM $TOP_PID
}
$ cat foo-main.sh
source ./foo-utils.sh
v=$(foo)
echo "$v"
echo "end-------------"
```

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]