parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: expected behavior of --results with -n0


From: Joel Uckelman
Subject: Re: expected behavior of --results with -n0
Date: Wed, 06 Jul 2016 21:30:03 +0200

Thus spake Joel Uckelman:
> 
> When I run this:
> 
>   seq 3 | parallel --results b -n0 echo hey
> 
> parallel writes me a directory tree like this:
> 
>   [uckelman@scylla tmp]$ tree b
>   b
>   └── 1
>       └── \\0
>           ├── seq
>           ├── stderr
>           └── stdout

I think I figured out why this happens---there is only one input
source (represented by b/1) and there is only one unique value which
comes from it, i.e., nothing, due to -n0, which gets represented
as a null escape, \0.

It looks like what I want instead is this:

  seq 3 | parallel --results b 'echo hey ; true'

Each run gets a unique value from the input, but those arguments are
all fed to 'true', which safely ignores the arguments it's given.

This gives me

  [uckelman@scylla tmp]$ tree b
  b
  └── 1
      ├── 1
      │   ├── seq
      │   ├── stderr
      │   └── stdout
      ├── 2
      │   ├── seq
      │   ├── stderr
      │   └── stdout
      └── 3
          ├── seq
          ├── stderr
          └── stdout

which is what I was aiming for.

Is using true as a no-op argument eater the most obvious way of
collecting the output from multiple same-argument invocations of one
command?

-- 
J.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]