When will an infinite loop end?
E.g. if I run
while :; do sleep 1; date +%s; done &
when will this end — on closing the terminal or on shutdown?
|
When will an infinite loop end? E.g. if I run
when will this end — on closing the terminal or on shutdown? |
||||
|
|
|
When you provide If you close the terminal application itself (Ctrl+F4, press the x in the window decoration, or Shift+Ctrl+W for But if you close the terminal using (I do not know why there is a difference between the two. I suspect that when you close the application, the operating system closes it and its children.) The following is different:
The When you use P.S. The command will not work with P.P.S. It is easier to see what is going on by running a GUI. Instead of the
Much quicker and easier to see what is happening, as the calculator disappears when it is killed; and you can kill it easily (just close the calculator). |
|||||||||||
|
|
If you supply |
|||