From 6e5044eb4ba064a497699208068d2553ac172f8c Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 17 Nov 2024 21:19:48 +0000 Subject: deploy: deb4619a79deace26923e91a93b6d7bbfce40e78 --- print.html | 57 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'print.html') diff --git a/print.html b/print.html index 3f180a5..2eb19a2 100644 --- a/print.html +++ b/print.html @@ -998,6 +998,7 @@ status -f # abs path of current file
  • tac
  • rev
  • paste
  • +
  • xargs
  • awk(1)

    awk [opt] program [input]
    @@ -1404,6 +1405,24 @@ echo -e 'a1 a2\nb1 b2\nc1 c2\nd1 d2' | paste - -
     # a1 a2	b1 b2
     # c1 c2	d1 d2
     
    +

    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
    +

    Tools

    -

    Example

    +

    Example

    # Forward requests on localhost:8080 to moose:1234 and keep ssh in forground
     # but dont drop into a shell.
     ssh -N -L 8080:1234 moose
    -- 
    cgit v1.2.3