Posts Categorized: shell

echo with new lines

For future reference: echo “This does not give \n a new line” does not work. I had used printf sometimes but the -e switch also works for echo: echo -e “This gives \n a new line”

nslookup mx records

$ nslookupDefault Server:  dnsserver.comAddress: > set q=mx>

Killing Memory Hogs

On an old server I temporarily added the following script as a cron job to find and kill processes using too much memory. This is just a stop gap until we get to the root of the problem. #!/bin/bashfor i in `ps -efl | grep “httpd” | awk ‘{ if ($10 > 16000) {print $4″… Read more »

Crontab -e returns a number

On a solaris system I sometimes try to edit the crontab file with crontab -e and all I get in return is a number (signifying the number of characters by the ed editor I believe). # crontab -e4025^C?The crontab file was not changed. I need to Ctrl-D to exit.To get the ball rolling again: EDITOR=vi;export… Read more »