First, you didn't read the thread, which asks about stopping something on the command line, then you assume some idiot is working in some language he doesn't know anything about. Then you have some smug comment about "details are important" like I'm a child. Yeah, they are, SO READ THEM.
I don't really care if you see no reason or not to loop a ping, that was the question. If you can't answer a question, then don't. The reason the ping is in there is just a simple filler example to replace my 5 commands that I'm sure you would judge and criticize, so I took those out, and put the ping in. Also, smarty, what if I need the ping count to stay under 4? What if the ping failed every third time? What if I wanted to alternate a 'date' command so I knew exactly when the pings were done instead of 10,000 pings with no time stamps. I might want to increment the payload, or change the intervals. Plenty of reasons, but again, I didn't ask for a tutorial on ping simplification.
Also your other thesis falls apart with the facts at hand. Control-c stops it on Linux VM under a Windows Host, but not under a Mac host in a terminal or Linux VM.
I did read the thread. In fact, I reread it, including my earlier replies. I also went and read your other posts, few though they were, to see if they shed any light on your experience level or gave insight into what kind of while loop you were referring to. Other than what you posted, I have no way of knowing what you know, or guessing what you might mean.
If you're having trouble with a specific command-line construct, then you need to post it, in the exact form that's causing the problem. Putting in fillers and placeholders may not work. You agreed that details are important, yet you posted an example whose details differed from the command-line you were having problems with.
One reason for posting the exact command-line you're having problems with is to replicate the problem here on my machine, and to study ways of solving the problem. If you post a different problem, then all I can do is to study the problem you posted.
One of the ways to solve problems is to restructure them. That's what I did with the ping example you posted. If you'd posted the actual commands you were having trouble with, I would have studied those. I might not have found a solution, but at least I'd be looking for a solution for what you were actually having a problem with. Since you didn't post it in any of your replies, I can't possibly offer any other ideas for solutions.
To see how ctrl-c or command-dot stops a while loop in the shell, try these:
Code:
while true; do true; done
while true; do false; done
while true; do sleep 5; done
You should see that each of these is interruptible. This suggests the problem isn't with the while/do/done per se, but something else. That's just a guess, since we still don't know exactly what commands you're having trouble with.