On 2/2/26 9:13 PM, 王伟 wrote:
test_crash ; if [[ $? -ne 0 ]] ; then
echo "case 1-1"
fi
The second method above also won't work. Isn't the purpose of a semicolon
to create a new line? Does it have some other side effect?
Its effect is to create a command list (one of the shell's compound
commands). It's not always equivalent to a newline.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/