4 ms·
Thats an interesting example. zsh does the right thing, when you bg it back it recovers the loop as it was. Bash seems to forget about the loop and only recove
by chaosfox 12y ago
Thats an interesting example.
zsh does the right thing, when you bg it back it recovers the loop as it was.
Bash seems to forget about the loop and only recovers the "sleep 1", when it starts executing again it sleeps 1 and exits.
If you want to make sure it will work you should wrap it around another bash:
bash -c 'while true ; do sleep 1 ; done'
should work fine.
- __david__ 12y agoParens work too: (while true ; do sleep 1 ; done)