parallel
[Top][All Lists]
Advanced

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

VOTE: When should skipped commands be included?


From: Ole Tange
Subject: VOTE: When should skipped commands be included?
Date: Fri, 9 Jul 2021 13:56:00 +0200

In replacement strings you can use 'skip()' to skip a command:

$ parallel echo {= '$arg[1] % 2 or skip();' =} ::: {1..5}
1
3
5

--filter can be used with a similar effect:

$ parallel --filter '{1} % 2' echo ::: {1..5}
1
3
5

In theory the skipped commands are never run (right now they are run
with 'true' prepended), but when should they show up?

What should -v do? It does this now:

$ parallel -v --filter '{1} % 2' echo ::: {1..5}
echo 1
1
echo 2
echo 3
3
echo 4
echo 5
5

What should --dry-run do? It does this now:

$ parallel --dr --filter '{1} % 2' echo ::: {1..5}
echo 1
echo 2
echo 3
echo 4
echo 5

Should skipped commands go into the joblog? Right now they get exit
value -2 to signify these are skipped.

$ parallel --jl - --filter '{1} % 2' echo ::: {1..5}
Seq     Host    Starttime       JobRuntime      Send    Receive
Exitval Signal  Command
1       :       1625831554.883       0.004      0       2       0
 0       echo 1
2       :       1625831554.886       0.005      0       0       -2
 0       echo 2
3       :       1625831554.891       0.006      0       2       0
 0       echo 3
4       :       1625831554.898       0.005      0       0       -2
 0       echo 4
5       :       1625831554.903       0.001      0       2       0
 0       echo 5

Is the current behaviour what you expect? If not: How should it change?


/Ole



reply via email to

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