Subject: Re: Korn shell behaviour
To: Richard Grace <rgrace@aapt.com.au>
From: None <collver@linuxfreemail.com>
List: netbsd-users
Date: 04/11/2002 19:13:32
On Fri, Apr 12, 2002 at 11:54:06AM +1000, Richard Grace wrote:
> This is something which has been on my mind for a long time.
> 
> I use the Korn shell, have done for years, and I like vi commands.
> 
> When executing ksh, the following things work:
> 
>   Solaris ->  # exec ksh -o vi
>   FreeBSD ->  # exec ksh -o vi
> 
> But, on NetBSD, I don't get vi commands.  I must do it like this:
> 
>   # exec ksh
>   # set -o vi
> 

In NetBSD, if I set my shell to /bin/ksh the vi commands work, I don't have
to explicitly enable them.

> And, the following does not work in my .profile the same as it
> does on Solaris or FreeBSD
> 
>   if [ $SHELL == '/bin/ksh' -o $SHELL == '/usr/bin/ksh' -o $SHELL == '/usr/local/bin/ksh' ]
>    then set -o vi
>   fi

The above works for me.
you might want to use = instead of ==
the single quotes are superfluous
I'm using the same version of ksh.

Ben