mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
rargs: add page (#11603)
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
This commit is contained in:
parent
0e7d2cea9c
commit
3b645a018b
1 changed files with 25 additions and 0 deletions
25
pages/osx/rargs.md
Normal file
25
pages/osx/rargs.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# rargs
|
||||
|
||||
> Execute a command for each line of standard input.
|
||||
> Like `xargs`, but with pattern matching support.
|
||||
> More information: <https://github.com/lotabout/rargs>.
|
||||
|
||||
- Execute a command for every line of input, just like `xargs` (`{0}` indicates where to substitute in the text):
|
||||
|
||||
`{{command}} | rargs {{command}} {0}`
|
||||
|
||||
- Do a dry run, which prints the commands that would be run instead of executing them:
|
||||
|
||||
`{{command}} | rargs -e {{command}} {0}`
|
||||
|
||||
- Remove the `.bak` extension from every file in a list:
|
||||
|
||||
`{{command}} | rargs -p '(.*).bak mv {0} {1}`
|
||||
|
||||
- Execute commands in parallel:
|
||||
|
||||
`{{command}} | rargs -w {{max-procs}}`
|
||||
|
||||
- Consider each line of input to be separated by a NUL character (`\0`) instead of a newline (`\n`):
|
||||
|
||||
`{{command}} | rargs -0 {{command}} {0}`
|
Loading…
Add table
Reference in a new issue