Bash Script will not stop.

3

So i had the bright idea of making a script that pings my IP to see if its up as i am having some issues with it. so here is the script I made.

while : 
do 
      ping (IP address)
done 

now it wont stop, I've tried control x, and z, but it still wont stop? Ive saved it under ~/ .bash_profile, any ideas? //sorry about the space, you know, stack exchange.

toasty

Posted 2015-08-23T03:32:30.933

Reputation: 57

2control-c is the break signal. Otherwise, kill the process id of the script. – Paul – 2015-08-23T03:38:45.333

Reboot and login as a different user. If your OS supports it ALT F2 to a second terminal windows. ps -ef |grep <script name> kill -9 <pid of script name> – cybernard – 2015-08-23T17:01:03.457

Should note that while the ping is running, i cant type anything, and i am on the defualt mac Os X terminal. – toasty – 2015-08-23T21:25:30.180

Answers

0

Your can press Ctrl + C to stop things that's "not stopping". On some systems might be Ctrl + Break.

Anyway, sometimes it does not stop immediately, or it won't response to Ctrl + c due to high load of system resources. so you might want to press Ctrl + C many times.

Tiw

Posted 2015-08-23T03:32:30.933

Reputation: 217

-1

You can use:

ping -c 1 8.8.8.8

Carol Castro

Posted 2015-08-23T03:32:30.933

Reputation: 1

Welcome to Super User! How will that kill the script that's running? – bertieb – 2019-02-07T13:25:55.887