Robin的主页

Bash Keywords

export

export makes the variable available to sub-processes. —— Defining a variable with or without export

&

If a command is terminated by the control operator &, the shell executes the command asynchronously in a subshell. —— Bash manual

wait & sleep

wait waits for a process to finish; sleep sleeps for a certain amount of time.

Bash Using Scenarios

get exit code of background process

To get the exit code from variety process exit codes, you could save the exit code to a temp file like this: echo "BUILD_CLIENT_STATUS=false" > /tmp/build_client_status.sh. Then, get those exit codes by excute . /tmp/build_client_status.sh.

- - - - - -
written by 陈烨彬 Robin Chen , and published under (CC) BY-NC-SA.