how set -vx saved my sanity
May 31, 2007 So i learned something new today, which as always is a good thing. I been setting up a Hobbit server running Ubuntu to replace our big brother server that is running on a Sun V240 with Solaris. One of the new things I needed to setup was monitoring for a couple of oracle databases that our engineer wanted to keep an eye on. He had some pre-made scripts that they used when he was with the IS group for their Big Brother setup and we were just going to port them over to our hobbit setup. Well after i tweaked the script to work with how hobbit client is configured. I noticed that one of the variables was getting set to nothing and it jacking up the rest of the script. I spent a good day and a half to figure what the hell was going on. I was at the point of just making my own monitoring script using perl to report back to the hobbit server. So in desperation I asked my buddy if by chance i was missing something stupid. I gave him a copy of what i had and he said to stick set -xv at the top of it and watch it run. He said it will output everything its doing and it should help catch whats going on. Sho nuff I added that little sucker to the top of the script and ran that bitch. Within a couple of minutes i realized what was going on and fixed the problem. Now we just need to figure out why the stupid thing is not connecting to the oracle instance like it should, which is going to be the job of the engineer. So in short, when your shell script is screwing and you don’t know why, add that little puppy and it should help you debug it. I know this more then likely something that is really stupid and obvious, but hey I didn’t know and now I do.

