Thursday, July 30, 2009

In Solaris 10, $EDITOR cannot contain arguments.

Some people got into the habit of setting the UNIX environment variable $EDITOR to a command and its arguments, for example "emacs -nw". This is no longer supported by crontab(1), as of Solaris 10. It doesn't seem to be documented anywhere, but Solaris 9 executed the editor command by running "sh -c", but Solaris 10's crontab command, instead, splits $PATH, joins $EDITOR to it, and runs execve(2) on each in turn until one works. Thus, it will try and run a program named "emacs -nw", not a program named "emacs" with an argument "-nw".

Nice undocumented change, Sun!

0 comments: