On Sat, 15 Oct 2011, Jean-Yves Migeon wrote:
+if [ -x `which vi` ]; then + export EDITOR=vi +fi + +if [ -x `which less` ]; then + export PAGER=less +fi
I don't think I like the idea behind this suggestion (complicating root's .profile), but if you insist on something along these lines, then please don't use "which".
"command -v less >/dev/null" will do the job using a shell builtin command. At least NetBSD's "which" doesn't go anywhere near csh aliases, but using a built-in is still better than using a program from /usr/bin.
--apb (Alan Barrett)