Explorar o código

xargs: add example as discussed in #878

Also moved the concrete example to the end.
Waldir Pimenta %!s(int64=8) %!d(string=hai) anos
pai
achega
f26d5164ae
Modificáronse 1 ficheiros con 8 adicións e 4 borrados
  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`