- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2019-07-26T15:15:44+00:00","","")
#topicpath
///////////////////////////////////////////////////////////////////////////////
* 目次 [#y5bfc779]
#contents();
///////////////////////////////////////////////////////////////////////////////
* xargs [#d0453ed2]
//=============================================================================
** option [#yf29a873]
///////////////////////////////////////////////////////////////////////////////
* 複数コマンドを実行する [#rd903c74]
- <command> の結果を、<command1> に渡して実行し、その後 <command2> に渡して実行する
$ <command> | xargs -I {} sh -c '<command1> {}; <command2> {}'
-- sh は bash でも、同じオプションをサポートしているなら他の如何なる shell でも良い。
-- オプション -c <string> は、文字列 <string> からコマンドを読み込む。
///////////////////////////////////////////////////////////////////////////////
* パラレル実行 [#ece2198b]
- <command> の結果を引数とし、<command2> を <thread-num> 個のスレッドでパラレル実行する
$ <command> | xargs -I {} -P <thread-num> <command2> {}