TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Unix command line queue utility

52 点作者 evandrix超过 9 年前

6 条评论

justin_vanw超过 9 年前
<p><pre><code> $ mkfifo ~&#x2F;.jobqueue $ parallel :::: ~&#x2F;.jobqueue </code></pre> now, from another terminal:<p><pre><code> echo ls &gt; ~&#x2F;.jobqueue </code></pre> Tada!<p>for a remote job queue, use nc instead of a fifo<p>for a job queue with a buffer, use a file, and run $ parallel :::: &lt;(tail -f thefile) you can even truncate the file from time to time.<p>Of course, this doesn&#x27;t capture the context you are in, such as your current directory or the value of shell variables.
评论 #10127743 未加载
评论 #10127558 未加载
kovek超过 9 年前
This stackoverflow answer[0] shows how you can queue jobs even after you start running other processes in your queue. Essentially, you can do:<p><pre><code> sleep 2; echo &quot;A&quot; &amp;&amp; sleep 2 ; echo &quot;B&quot; &amp;&amp; sleep 2 ; echo &quot;C&quot; # Quickly Ctrl-Z fg &amp;&amp; sleep 2 ; echo &quot;D&quot; </code></pre> and you will see A\nB\nC\nD\n slowly printed out in your terminal.<p>[0]: <a href="http:&#x2F;&#x2F;superuser.com&#x2F;a&#x2F;345455" rel="nofollow">http:&#x2F;&#x2F;superuser.com&#x2F;a&#x2F;345455</a>
CyberShadow超过 9 年前
Could you please add some usage examples or elaborate on when this tool would be useful? For example,<p>&gt; building several targets of a Makefile<p>As opposed to `make &amp;&amp; sudo make install` ?<p>&gt; downloading multiple files one at a time<p>As opposed to `(wget url1 &amp;) ; (wget url2 &amp;)` ?<p>&gt; or simply as a glorified `nohup`<p>As opposed to `nohup` ?
评论 #10126369 未加载
评论 #10126248 未加载
jschwartzi超过 9 年前
Which systems guarantee monotonic behavior for gettimeofday()? I can&#x27;t think of any. I hope there&#x27;s no behavior in nq which relies on monotonicity other than file naming, because otherwise you might run into some obscure issues.
pwg超过 9 年前
How does this differ from task spooler:<p><a href="http:&#x2F;&#x2F;vicerveza.homeunix.net&#x2F;~viric&#x2F;soft&#x2F;ts&#x2F;" rel="nofollow">http:&#x2F;&#x2F;vicerveza.homeunix.net&#x2F;~viric&#x2F;soft&#x2F;ts&#x2F;</a>
dsl超过 9 年前
cat list.txt | xargs -n 1 -P 20 wget<p>Queues up 20 concurrent downloads with wget, for example.
评论 #10126576 未加载