How do I get PID bash?

Ngoc Hue

New member
How do I get PID bash?
Answer
One can easily find the PID of the last executed command in shell script or bash. This page explains how to get the PID of a last executed app/program.
…
The syntax is as follows:
  1. Open the terminal application.
  2. Run your command or app in the background. …
  3. To get the PID of the last executed command type: echo “$!”
 

Tìm kiếm

Back
Top