Hacker News new | ask | show | jobs
by justin_vanw 3954 days ago

   $ mkfifo ~/.jobqueue
   $ parallel :::: ~/.jobqueue
now, from another terminal:

   echo ls > ~/.jobqueue
Tada!

for a remote job queue, use nc instead of a fifo

for a job queue with a buffer, use a file, and run $ parallel :::: <(tail -f thefile) you can even truncate the file from time to time.

Of course, this doesn't capture the context you are in, such as your current directory or the value of shell variables.

2 comments

Here is an alternative:

  tty1$ mkfifo /tmp/jobqueue
  tty1$ eval $(tail -n 1 /tmp/jobqueue)
And then, in another terminal:

  tty2$ echo ls > /tmp/jobqueue
What's 'parallel'? Is it a *nix command? Looks like its not available on Fedora box
Yes, it's a GNU tool. Try "yum install parallel".

http://www.gnu.org/software/parallel/