changed shell from bash to sh HELP

Ok so I've changed my shell from bash to sh but now when I use the arrow keys I only get ^[[A^[[B etc etc.

It is not recording commands anymore why? Can I fix this somehow?

Thank you.
 
sh(1) suggests starting with -E for emacs editing mode or -v for vi editing mode. As for history, I don't know. Honestly, I don't use /bin/sh interactively any more than I must.
 
FreeBSD has no bash, unless you installed it yourself. It has sh and (t)csh, with the latter for root and whatever you chose for your user(s).

Yes can you can fix it. The same way you just did it, only this time in the opposite way. ;)
Since bash is a port, you won't find it in /bin but in /usr/local/bin.

Hint: chpass(1) and [cmd=""]cat /etc/shells[/cmd].
 
but why is not working?

I am using /bin/sh on other accounts (users) and they work normal. Why root can't remember commands?
 
Could you *please* read my post? Root uses (t)csh by default, not sh.

Do an [cmd=""]echo $SHELL[/cmd] on your other accounts to see what they're using and I bet it'll say /bin/csh.

And one more thing: keep anything in the root account (e.g. shell) as it is by default.
 
Beastie said:
Could you *please* read my post? Root uses (t)csh by default, not sh.

Do an [cmd=""]echo $SHELL[/cmd] on your other accounts to see what they're using and I bet it'll say /bin/csh.

And one more thing: keep anything in the root account (e.g. shell) as it is by default.

Here you go from 5 accounts

$ echo $SHELL
/bin/sh
$
 
ok listen: command history is implemented in libedit. /bin/sh uses this library, and you can access history with the arrow keys by enabling emacs mode:
Code:
$ set -o emacs

Note that linux doesn't have a bourne shell: /bin/sh is a link to /bin/bash.

/bin/sh on freebsd doesn't have a completion feature though. You know what I mean: The thingy where you're hammering your tab key all the time when using bash.

Also note that bash is linked against libreadline, which is the gnu counterpart to libedit. All history related features like ^R (reverse history search) are implemented in this library and work differently from libedit.

So my guess is that what you really want is to use bash, and therefore you have to install it from the ports. But it is true that you should not change root's shell to bash for safety reasons. You can run sh and csh without /usr mounted so it is more likely to work. If root's shell cannot be started, your effectively locked out. So just start the bash manually after successfully logging in.
 
Back
Top