Using chpass with ee


I’ve just now removed vi, the editor also found in Linux that’s very user unfriendly, but an important command, chpass, that changes user database defaults to vi, but I instead prefer ee, the FreeBSD easy editor that’s similar to nano in Linux, working for the chpass command, here I’m fallen under the below options.
In short I need to run this to replace with bash as my own login shell for myself. :smiley:
Running chpass within ee, this can be done thru,

set EDITOR=ee && sudo chpass hd_scania # hd_scania is my mutual online alias

or running ee on my own chpass directory, but requires database querying,

sudo /usr/libexec/locate.updatedb && locate hd_scania|grep -e chpass
sudo ee /etc/path/to/my/chpass/file

Any other ways to have done a similar task? :sun_with_face:


If you’re so fond of ee, why not make it your default editor?

# .bashrc or .bash_profile
export EDITOR=ee

But seriously, sudo pkg install vi is probably the better option.


Typically vi is vim on a Linux system. Straight up vi predates Linux (it’s been in commercial Unix offerings like SunOS, Solaris, DEC Unix and others).
I believe that vi on FreeBSD is part of the base system (it’s in /usr/bin).

I’m also going to say that I don’t find vi unfriendly at all. One just has to learn the right key combos and keep in mind that it’s modal. But everyone has an opinion on editors based on how they work.

@vit has the correct way of doing it.



# set | grep EDITOR

# vipw

Or changing Your own shell:
$ chsh