「shell入門」PIDを取得するサンプル

サンプルコード:
#!/bin/bash

echo “PID of this script: $$”
echo “PPID of this script: $PPID”
echo “UID of this script: $UID”

結果:
PID of this script: 7686
PPID of this script: 3656
UID of this script: 1000

Comments are closed.