ソースを参照

xargs: add example as discussed in #878

Also moved the concrete example to the end.
Waldir Pimenta 8 年 前
コミット
f26d5164ae
1 ファイル変更8 行追加4 行削除
  1. 8 4
      pages/common/xargs.md

+ 8 - 4
pages/common/xargs.md

@@ -10,10 +10,14 @@
 
 `{{arguments_null_terminated}} | xargs -0 {{command}}`
 
-- Delete all files that start with 'M':
+- Insert arguments at chosen position, using '%' as the placeholder marker:
 
-`find . -name 'M*' | xargs rm`
+`{{arguments}} | xargs -I '%' {{command}} % {{extra_arguments}}`
 
-- Insert arguments at chosen position, using '%' as the placeholder marker:
+- Use the output of one command as arguments to another command:
 
-`{{arguments}} | xargs -I % {{command}} % {{extra_arguments}}`
+`{{command1}} | xargs {{command2}}`
+
+- Specific example: delete all files that start with 'M':
+
+`find . -name 'M*' | xargs rm`