シェルスクリプト (bash) で GNU parallel を利用して計算を行い、
その結果をテキストファイル に書き出そうとしています。
しかし、計算結果を標準出力として出力する方法が分かりません。
標準関数を使ってマルチコアで出力することはできます。
$cat line.txt | parallel -j 32 -a - echo 1 2 3
my_echo.sh の中身
#!/bin/bash my_echo () { echo $1 }
GNU parallel を使わずに my_echo を使用すると期待通りの動きをしますが、
上記のコマンドの "echo" を "my_echo" に変えると、
line.txt の中身が表示されません。
$my_echo 1 1 $cat elephant.line.txt | parallel -j 32 -a - ./my_echo.sh Academic tradition requires you to cite works you base your article on. If you use programs that use GNU Parallel to process data for an article in a scientific publication, please cite: O. Tange (2018): GNU Parallel 2018, Mar 2018, ISBN 9781387509881, DOI https://doi.org/10.5281/zenodo.1146014 This helps funding further development; AND IT WON'T COST YOU A CENT. If you pay 10000 EUR you should feel free to use GNU Parallel without citing. More about funding GNU Parallel and the citation notice: https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice To silence this citation notice: run 'parallel --citation' once. Come on: You have run parallel 137 times. Isn't it about time you run 'parallel --citation' once to silence the citation notice? $
最終的には "1 2 3" という出力をファイルに書き出そうとしています。
ご回答、どうぞよろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/10 04:10