2
bashスクリプトで、stdoutを行ごとにキャプチャする方法
bashスクリプトでは、長いコマンドの標準出力を1行ずつキャプチャして、初期コマンドの実行中にそれらを分析および報告できるようにします。これは私がそれを行うことを想像できる複雑な方法です: # Start long command in a separated process and redirect stdout to temp file longcommand > /tmp/tmp$$.out & #loop until process completes ps cax | grep longcommand > /dev/null while [ $? -eq 0 ] do #capture the last lines in temp file and determine if there is new …