linux - Last run with different options GNU Parallel -


i've parallelized cycle in bash using gnu parallel. simple example show want reach:

seq 10 | parallel -n0 echo "hello world" & 

i detach terminal run, except last one, removing & in last cycle. there way this?

edit: since not clear, i'll try explain myself in better way:

i have simulator starting, gnu parallel launch many times same script connect simulator. want of them detaching terminal except last 1 avoid confusion overlapping output.

there no option that, default first job gets /dev/tty input. maybe can run last job first?

if want output , not input should work:

seq 10 | parallel echo hello world '> {= $_= $job->seq() == total_jobs() ? "/dev/tty" : "/dev/null" =}' 

(requires version 20160122 or newer)

otherwise workaround save files , output last file:

seq 10 | parallel --files -n0 echo hello world | tail -n1 | parallel -u cat 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -