From 6e5044eb4ba064a497699208068d2553ac172f8c Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 17 Nov 2024 21:19:48 +0000 Subject: deploy: deb4619a79deace26923e91a93b6d7bbfce40e78 --- cli/index.html | 1 + cli/paste.html | 4 +- cli/xargs.html | 227 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 cli/xargs.html (limited to 'cli') diff --git a/cli/index.html b/cli/index.html index 1560dd1..1aa6864 100644 --- a/cli/index.html +++ b/cli/index.html @@ -166,6 +166,7 @@
  • tac
  • rev
  • paste
  • +
  • xargs
  • diff --git a/cli/paste.html b/cli/paste.html index a3f0a60..992467f 100644 --- a/cli/paste.html +++ b/cli/paste.html @@ -181,7 +181,7 @@ echo -e 'a1 a2\nb1 b2\nc1 c2\nd1 d2' | paste - - - @@ -195,7 +195,7 @@ echo -e 'a1 a2\nb1 b2\nc1 c2\nd1 d2' | paste - - - diff --git a/cli/xargs.html b/cli/xargs.html new file mode 100644 index 0000000..fd14038 --- /dev/null +++ b/cli/xargs.html @@ -0,0 +1,227 @@ + + + + + + xargs - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + + + + +
    +
    +

    xargs(1)

    +
    xargs [opts] [cmd [init-args]]
    +    -l [<num>]   maximal number of lines per cmd invocation
    +                 if <num> it not provided, num=1 is assumed
    +    -I <str>     replace <str> in the [init-args] with the arg;
    +                 this implies -l, and hence processes one arg at a time
    +
    +

    Example

    +

    Collect arguments and prefix them with another option.

    +
    # Using -l to process one arg at a time.
    +eval strace -f (find /dev -name 'std*' | xargs -l echo -P | xargs) ls
    +
    +# Using -I to place the arg at the specified location.
    +eval strace -f (find /dev -name 'std*' | xargs -I {} echo -P {}) ls
    +
    +# Both commands achieve the same thing and result in something like:
    +#   eval strace -f -P /dev/stdin -P /dev/stdout -P /dev/stderr ls
    +
    + +
    + + +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + +
    + + -- cgit v1.2.3