Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, print out the PID of the last background process that was executed (for example, via the & syntax).
Answer

echo $!

^^ note that $ denotes variable expansion, and ! is special variable to represent PID of last background process executed


Question
In linux, print out the PID of the last background process that was executed (for example, via the & syntax).
Answer
?

Question
In linux, print out the PID of the last background process that was executed (for example, via the & syntax).
Answer

echo $!

^^ note that $ denotes variable expansion, and ! is special variable to represent PID of last background process executed

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
mand, or those set by the shell itself (such as the -i option). $$ Expands to the process ID of the shell. In a () subshell, it expands to the process ID of the current shell, not the subshell. <span>$! Expands to the process ID of the most recently executed background (asynchronous) command. [I.e., after executing a background command with command &, the variable $! will give its

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.