この文
echo $id
前のステートメントまで実行できません
id=`taskset -c 0 python <path>/run-apps.py <thread> | grep "pid" | awk '{print $2}'`
完了します。必要ない場合は$id、削除して実行してください
taskset -c 0 python <path>/run-apps.py <thread> | grep "pid" | awk '{print $2}'
生成された出力を表示します(ただし、Martijn が指摘したように、バッファリングを無効にする必要がある場合があります)。必要な場合は$id、コマンドを使用しteeて出力のコピーを保存し、同時に標準エラーに出力できます。
id=$(taskset -c 0 python <path>/run-apps.py <thread> |\
grep "pid" | awk '{print $2}' | tee /dev/stderr) # Or some other file descriptor that goes to your terminal
3 番目のオプションは、一時ファイルを使用することです。
taskset -c 0 python <path>/run-apps.py <thread> | grep "pid" | awk '{print $2}' > tmpfile &
tail --pid $! -f tmpfile # Watch tmpfile until the backgrounded job completes
do-other-job --reading-from tmpfile