-
Notifications
You must be signed in to change notification settings - Fork 0
shell and commands
foolmacky edited this page Oct 27, 2022
·
7 revisions
- xargsは前のコマンドの実行結果をstdinから受け取って、次のコマンドの引数に渡す「仲介役」をするコマンド
- マルチプロセスで並列実行される:速い
command1 | xargs command2 [command1の出力]
- 例
find ./*.txt -ctime -90 | xargs -n 1 -t -I{} sudo mv {} /Users/tmp/
find ./*.txt | xargs -L 100 sudo rm -f
//-L 与える行数
//-n 与える引数の数
//-I プレースホルダ指定
//-t 実際に実行されるコマンドを表示する
//128通りのスクリプトを64並列のアクセスで3回繰り返す
for i in `seq 0 2`
do
echo loop $1
seq 0 128 | xargs -I{} -P 64 sqlplus -S hoge/pass@ORACLE @insert{}.sql
done