3 ms·
I tried it, and you're right - but why does this happen?
by zilog80 12y ago
I tried it, and you're right - but why does this happen?
- zwp 12y agowhile, true, do, done are all [bash] shell builtins. They are not running processes that can be suspended. sleep(1) is the only process that can be suspended in this command. When you "fg", the suspended sleep(1) is signaled, and resumes. And then it exits. When you do this in a subshell (in parens), you suspend/resume the subshell in its entirety, which capture the loop construct. Why does it work in zsh?!