理科系の勉強日記

Linux/Ubuntu/Mac/Emacs/Computer vision/Robotics

stdout: Broken pipe

gnuplot> plot "<cat vec.dat | head -23" using 3 with line

vec.datは30万行を超えるデータである.catの結果をパイプでheadに渡すと

cat: stdout: Broken pipe

などと仰った.パイプが壊れたようだ.

これはcatの結果が30万行と膨大で,その結果が終わるまでにheadを読み込んでいるためと思われる.そもそもcatの後にhaedをする必要は無い.正しくは

gnuplot> plot "<head -23 vdc.dat" using 3 with line

でよい.