Does $! exists in bash/shell script, if yes, please inform for what it is used for. And why it gives blank when echo $!
is run on the command line?
相关问题
- How to get the return code of a shell script in lu
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- JQ: Select when attribute value exists in a bash a
- Invoking Mirth Connect CLI with Powershell script
$! - shows last process ID which has started in background.
$!
is the PID of the last program your shell ran in the backgroundIn addition to other answer, this echo
Will print blank if you haven't yet run any process in background in current shell. If you now run:
Then it will print something like (i.e. process id of last executed background process):