소스 검색

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`