App/xargs
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#y5bfc779]
#contents();
/////////////////////////////////////////////////////////...
* xargs [#d0453ed2]
//=======================================================...
** option [#yf29a873]
/////////////////////////////////////////////////////////...
* 複数コマンドを実行する [#rd903c74]
- <command> の結果を、<command1> に渡して実行し、その後 <...
$ <command> | xargs -I {} sh -c '<command1> {}; <command...
-- sh は bash でもOK。同じオプションをサポートしているな...
-- オプション -c <string> は、文字列 <string> からコマン...
/////////////////////////////////////////////////////////...
* パラレル実行 [#ece2198b]
- <command> の結果を引数とし、<command2> を <thread-num> ...
$ <command> | xargs -I {} -P <thread-num> <command2> {}
/////////////////////////////////////////////////////////...
* 標準入力から受け取った文字列を1個づつコマンドに渡す [#...
//=======================================================...
** -n1 を使う [#y32ffec4]
- -I オプションを併用する必要がなければ、 -n1 を指定する...
//=======================================================...
** -n1 が使えない場合 [#u85f8000]
- -I オプションは、空白文字を区切り文字として認識せず、コ...
# 例: DB ファイルを sqlite3 コマンドに渡す。
data_bases=( aaa.sqlite bbb.sqlite ccc.sqlite ddd.sqlite )
echo ${data_bases[@]} | tr ' ' '\n' | xargs -I {} sh -c ...
終了行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#y5bfc779]
#contents();
/////////////////////////////////////////////////////////...
* xargs [#d0453ed2]
//=======================================================...
** option [#yf29a873]
/////////////////////////////////////////////////////////...
* 複数コマンドを実行する [#rd903c74]
- <command> の結果を、<command1> に渡して実行し、その後 <...
$ <command> | xargs -I {} sh -c '<command1> {}; <command...
-- sh は bash でもOK。同じオプションをサポートしているな...
-- オプション -c <string> は、文字列 <string> からコマン...
/////////////////////////////////////////////////////////...
* パラレル実行 [#ece2198b]
- <command> の結果を引数とし、<command2> を <thread-num> ...
$ <command> | xargs -I {} -P <thread-num> <command2> {}
/////////////////////////////////////////////////////////...
* 標準入力から受け取った文字列を1個づつコマンドに渡す [#...
//=======================================================...
** -n1 を使う [#y32ffec4]
- -I オプションを併用する必要がなければ、 -n1 を指定する...
//=======================================================...
** -n1 が使えない場合 [#u85f8000]
- -I オプションは、空白文字を区切り文字として認識せず、コ...
# 例: DB ファイルを sqlite3 コマンドに渡す。
data_bases=( aaa.sqlite bbb.sqlite ccc.sqlite ddd.sqlite )
echo ${data_bases[@]} | tr ' ' '\n' | xargs -I {} sh -c ...
ページ名: