by andrey_utkin · 5y ago · 0 comments
> cat - concatenate files and print on the standard output
> nohup - run a command immune to hangups, with output to a non-tty
> at — execute commands at a later time
Anyway, it's good to see new conceptual tools being developed for the Unix Toolbox, keep up!
> Build targets clean, depends, all, without occupying the terminal
This accommodates a workflow where one wouldn't prefer to just open up another terminal to do other stuff (maybe you're not in a graphical environment, maybe there's no tmux, etc.). With just the shell features, one could do `make ... && make ... && make ... &`, but that would cause bothersome output that would prevent you from effectively working in the same terminal. One could redirect the output of those commands, but then you lose it, or you have to think of where to collect it. This provides an alternative where you can background and still have convenient access to the output when you need it.
The other use is something like:
$ nq mpv $youtube_url
$ #work... work... work....
$ nq mpv $next_youtube_url
so that the next starts when the first finishes.
make .. && make foobar && make ..
and you wanted to just run 'make foobar' again you'd search your history for the last foobar invocation, and be required to do some editing. With nq this wouldn't be necessary.
It's also not clear to me if nq has '&&' or ';' semantics in the event a command fails. I suspect it's ';'.
Clever and fun tool but unlikely I'll adopt it.
The scriptability of mpv is really nice if you're the sort of person who likes building your perfect environment, and also a huge pit of addictive time sinks. </warning>
There are a lot of examples and a FAQ section + a Wiki, if you're interested in more information why one might need such a tool.
Some attempts:
* shell-controllable queue of commands * queue for running commands one after another
but I still think the README's is the best.
It queues up Unix (shell) jobs. Do you understand what's meant by a shell "job"? Like "cmd &"?
Typing "cmd1 &", "cmd2 &", etc, runs jobs in parallel. "nq cmd1", "nq cmd2", runs them serially, in a queue.
cmd && cmd2 &
edit: From reading other comments I guess the difference is not mainly that it keeps running if the shell dies but that it allows you to easily append new stuff to the end of the queue
Obviously it's a queue and it's as simple as `nq cmd`. Also one can see the status with `fq`