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