아래 bash는 스크립트출구 bash는
#!/bin/bash
set -x
function doSomething() {
callee
echo "It should not go to here!"
}
function callee() {
(echo "before") && (echo "This is callee" && exit 1)
echo "why I can see this?"
}
doSomething
이며,이 결과는 ...
+ set -x
+ doSomething
+ callee
+ echo before
before
+ echo 'This is callee'
This is callee
+ exit 1
+ echo 'why I can see this?'
why I can see this?
+ echo 'It should not go to here!'
It should not go to here!
내가 명령 "exit"를 보았다
,
하지만하지 않았다 출구에서 작동하지 않습니다 스크립트를 종료하십시오.종료가 작동하지 않는 이유는 무엇입니까?