CLI Magic: Running multiple jobs with xjobs (Linux.com)
Posted Oct 10, 2006 16:01 UTC (Tue) by
TwoTimeGrime (guest, #11688)
In reply to:
CLI Magic: Running multiple jobs with xjobs (Linux.com) by bfields
Parent article:
CLI Magic: Running multiple jobs with xjobs (Linux.com)
> And "man xargs" shows that xargs has a "--max-procs"/"-P" argument which
> looks like it'd accomplish essentially the same thing as xjobs, except for
> figuring out how many processors you have for you.
From the <a href="http://www.maier-komor.de/xjobs.html">xjobs web page</a>:
<blockquote>
Yes, GNU's xargs has an option -P that allow parallelizing jobs. But you must tell xargs how many arguments to pass to each job, as it doesn't make a difference between a space and a newline charakter. In consequence each job issued by xargs must have the same number of arguments, whereas xjobs can handle different jobs with different commands and different number of arguments.
<p>
Additionally, xjobs support I/O redirection, which makes some applications possible that cannot be done with GNU's xargs. xjobs also determines the number of processors automatically, whereas xargs must be told how many processes to start. Finally, non-GNU xargs (e.g. Solaris' and DEC/Compaq/HP Alpha's) don't have the option -P. Try to do the following with GNU's xargs:
<p>
ls -1 *.mp3 | sed 's/\(.*\)\.mp3/"\1.mp3" > "\1.wav"/' | xjobs -- mpg123 -s
</blockquote>
(
Log in to post comments)