Nothing stupid about them...

...I just stole the name from David Letterman's "stupid pet tricks". I hope these tips help you avoid or fix mistakes along the way in your *nix administration duties.

Monday, December 15, 2008

Repetitive tasks 101

It happens all the time, but recently I was helping with some troubleshooting. The request was for me to issue a telnet command from our UNIX system so that the network people could see the packets and figure out where they were being dropped.

After about the 20th time, I was getting tired of hitting [up-arrow, enter]. So I entered a script at the command line of this system:


# while :
> do
> telnet 192.168.1.50 &
> sleep 10
> pkill telnet
> done


I advised them that the system would repeat the telnet request every ten seconds, kill it, and launch a new one. Repeatedly. For as long as it took.

Then I went and got coffee.

Search

Google