4 ms·
Because you can append commands at any point you like without worrying if previous commands have completed or not.
by aidenn0 6y ago
Because you can append commands at any point you like without worrying if previous commands have completed or not.
- jolmg 6y agohttps://unix.stackexchange.com/questions/572616/run-a-bash-command-when-a-process-is-done https://unix.stackexchange.com/questions/572616/run-a-bash-c... You can do that with the regular shell, just `^Z%; $next_command`, but I agree that nq might be more practical if that kind of workflow is done often.
- aidenn0 6y agoThat requires you still have the original shell open that ran the earlier commands; nq doesn't appear to have that limitation.
- jolmg 6y agoOk, that sheds light into the kind of workflow this might be useful in, like calling stuff from a launcher instead of a terminal or something like that and having them go through nq automatically. Personally, I would just keep the shell open, but options are cool.
- sickygnar 6y agonohup detatches the process from the shell
- aidenn0 6y ago...but doesn't queue jobs
- amelius 6y agoYou can use e.g. the "screen" utility to detach from a shell and later re-attach. I use this often: start something at work, detach, then go home, re-attach. You can have multiple sessions, give them names, etcetera.
- aidenn0 6y agoI'm well aware of screen/tmux/dtach/&c. If you accidentally exit the shell with all the jobs, you are done adding jobs to the queue, no?
- tenebrisalietum 6y agoI was thinking an advantage is that you can halt the queue, and/or the queue will pick up where it left off (on the next item in the queue) if power is cut. Not sure that this does that, though.
- aidenn0 6y agoA quick read makes me think it does not do that. Instead when one process exits it looks for more queued job files. [edit] I suppose if you ran nq on boot, it would find the existing queued job files and you would only lose the one running job? Or maybe it would rerun the one that was in progress. Not sure.