Does FreeBSD /bin/sh use readline?

I am new to FreeBSD. I have it installed and working and am trying to adjust a few preferences. I have found that a few Control-key and Escape-key key sequences don't work as expected at the command prompt. I have read that some shells, such as bash, uses readline for reading and processing the command line. There is a man page in FreeBSD for readline. I have tried creating my own ~/.inputrc file and creating some custom key bindings, but they don't seem to be working. So, does sh use readline? (I'm guessing that because the man page for sh doesn't mention "readline" or "inputrc" that the answer is probably "no".)

Charles Bailey
 
No. Readline is a GNU project. FreeBSD base should not contain any GPL-licensed code.

If you want to know which libraries some native binary uses, try ldd(1). Here:
Code:
$ ldd /bin/sh
/bin/sh:
        libedit.so.8 => /lib/libedit.so.8 (0x3ec7916c1000)
        libc.so.7 => /lib/libc.so.7 (0x3ec793233000)
        libtinfow.so.9 => /lib/libtinfow.so.9 (0x3ec7945e8000)
        [vdso] (0x3ec790f3a000)

So you see, FreeBSD's /bin/sh uses Editline (libedit.so) instead.
 
I think devel/readline is a shells/bash thing.
If you really want bash just install it, it's possible ;)
readline is also used by lots of other programs. Python and Perl use it by default (don't know whether it can be turned off when building them). One interesting (odd) thing about readline is that it is GPL licensed, not LGPL, meaning that if you use it, your whole source code has to GPL licensed (or another license compatible with it). I've used readline directly in other software I've written (but not distributed).

And: nothing wrong with using bash; I use it on my FreeBSD systems (and MacOS and Linux), even for root.
 
And: nothing wrong with using bash; I use it on my FreeBSD systems (and MacOS and Linux), even for root.
I've got no problem with that, I personally switched to shells/zsh my toor account every where, user account is on
sh or zsh it depends if it's a VM/jails or real hardware, even with a minimal configuration zsh is enjoyable.

readline is also used by lots of other programs. Python and Perl use it by default (don't know whether it can be turned off when building them). One interesting (odd) thing about readline is that it is GPL licensed, not LGPL, meaning that if you use it, your whole source code has to GPL licensed (or another license compatible with it). I've used readline directly in other software I've written (but not distributed).
I didn't know that, thank you.
 
Back
Top