Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is this different from simply serializing your commands by putting them, in the desired order, in a batch script?


Because you can append commands at any point you like without worrying if previous commands have completed or not.


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.


That requires you still have the original shell open that ran the earlier commands; nq doesn't appear to have that limitation.


Ok, 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.


You 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.


I'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?


nohup detatches the process from the shell


...but doesn't queue jobs


I 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.


A 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.


It is not, but REPL is useful even if you can run script from file. It's like that.


You can also use `;` and `&` as well as redirections and job control in an interactive shell session.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: