Monday, February 20, 2012

Problems editing crontab

You ever go to edit the crontab file on  a server, enter the command 'crontab -e', and get a number back?  Yeah, happened to me today.  I su - into root to edit the crontab and get a number. 

It's because the default editor for crontab is 'ed'.  To get around this, at least temporarily, you can do the following to make vi the editor for crontab:

#EDITOR=vi
#export EDITOR

Now you can edit the crontab file using the crontab -e command.

And, yes, this is in bash shell.

Mike

Thursday, February 16, 2012

Solaris: Garbage characters in a terminal window

You ever do something on the command line in a terminal and when it is done everything you type is a strange character?  I did that again today so I thought I'd hunt down something to fix it rather than just exit and restart a new terminal window.

What I found that worked (in my bash shell) was to copy/paste the following into the terminal window:
alias vtn='echo "X[mX(BX)0OX[?5lX7X[rX8" | tr "XO" "\033\017"'

This creates an alias called vtn which, when executed, cleans up the mess!

I found this at the following location complete with an explanation of what is being done:
http://www.in-ulm.de/~mascheck/various/alternate_charset/#solution

My thanks to Sven Mascheck mascheck@in-ulm.de !!

Mike