Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このコマンドnetstat -t 1 -i 2>&1 > $NETStat_OUT_FILE &をスクリプト内で実行すると、netstat の出力がファイルにリダイレクトされません。
netstat -t 1 -i 2>&1 > $NETStat_OUT_FILE &
最初に stdout をリダイレクトし、次に stderr をリダイレクトする必要があります。
netstat -t 1 -i > $NETStat_OUT_FILE 2>&1 &
タイミングの問題を解決するために、waitを使用できます。
netstat ... & p=$! do something else ... wait $p