xargs: add example as discussed in #878

Also moved the concrete example to the end.
waldyrious/alt-syntax
Waldir Pimenta 2016-05-16 07:51:34 +01:00
parent eb1f864263
commit f26d5164ae
1 changed files with 9 additions and 5 deletions

View File

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