Re: tmux and

2018-02-12 Thread Ole Tange
On Mon, Feb 12, 2018 at 10:29 PM, Ole Tange  wrote:
> On Mon, Feb 12, 2018 at 12:33 AM, Mathias Korber  wrote:
:
>> Is there a way to:
:
>> b) make parallel keep a pane (and the tmux session) for any
>> command that returns != 0?
:
> Each failed job will, however, take up one job-slot.

If you do not want them to take a job-slot, then the change is around line 8040:

 q[ perl -e 'while($t++<3){ print $ARGV[0],"\n" }'
$?h/$status >> ].$tmpfifo."&".

Here you will need to make the perl script sleep after printing the
return code (and flushing stdout).


/Ole



Re: tmux and

2018-02-12 Thread Ole Tange
On Mon, Feb 12, 2018 at 12:33 AM, Mathias Korber  wrote:
> The tutorial says:
:
>> Using --tmux GNU parallel can start a terminal for every job run:

Great to see someone is using the --tmux. I feel confident you are in
an elite group :)

> Is there a way to:
> a) change that 10 second reap time
> b) make parallel keep a pane (and the tmux session) for any
> command that returns != 0?

Not directly. But it is fairly easy to code - as long as you only want
a longer reap time:

parallel --tmux 'echo {};(exit {}) || sleep 10' ::: 0 0 1 2 0 0 3 4 0 0 5 6

Each failed job will, however, take up one job-slot.


/Ole



Re: tmux and

2018-02-12 Thread Mathias Korber

> And that example currently fails on my installation (from source):
> 
> $ seq 10 20 | parallel --tmux 'echo start {}; sleep {}; echo done {}'
> parallel: Error: Command line too long (37 >= -33) at input 0: 10
> 
> $ parallel --version | head -1
> GNU parallel 20180122
> 
> $ tmux -V
> tmux 2.6


matjes-Mac-mini:bin mathias$   seq 10 20 | parallel --tmux 'echo start
{}; sleep {}; echo done {}'
See output with: tmux -S
/var/folders/j_/7j3vrftd01s3bx6v6xgkkxn0gp/T//tmsQs1C9 attach

matjes-Mac-mini:bin mathias$ parallel --version | head -1
GNU parallel 20180122
matjes-Mac-mini:bin mathias$

matjes-Mac-mini:bin mathias$ tmux -V
tmux 2.6






Re: tmux and

2018-02-12 Thread Martin Møller Skarbiniks Pedersen
On 12 February 2018 at 00:33, Mathias Korber  wrote:
> The tutorial says:
>
>
>> A terminal for every job
>>
>> Using --tmux GNU parallel can start a terminal for every job run:
>>
>>   seq 10 20 | parallel --tmux 'echo start {}; sleep {}; echo done {}'

And that example currently fails on my installation (from source):

$ seq 10 20 | parallel --tmux 'echo start {}; sleep {}; echo done {}'
parallel: Error: Command line too long (37 >= -33) at input 0: 10

$ parallel --version | head -1
GNU parallel 20180122

$ tmux -V
tmux 2.6

Regards
Martin