I think I've noticed this before but never thought about it much; now I'm curious.> ldd /bin/bash        linux-vdso.so.1 =>  (0x00007fff2f781000)        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f0fdd9a9000)        libdl.so.2 => /lib64/libdl.so.2 (0x00007f0fdd7a5000)        libc.so.6 => /lib64/libc.so.6 (0x00007f0fdd3e6000)        /lib64/ld-linux-x86-64.so.2 (0x00007f0fddbf6000)Libtinfo is part of ncurses.  This is a fedora system, but it is the same on ubuntu, and I notice on raspbian (a debian variant) it also links to libncurses itself.What's the reason for this?  I thought everything bash did could be done with libreadline (which curiously, it does not link to).  Is this simply a substitute for that?
Why does bash link to ncurses?
bash;readline;ncurses
If you run bash as:LD_DEBUG=bindings bashon a GNU system, and grep for bash.*tinfo in that output, you'll see something like:   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `UP'   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `PC'   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `BC'   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `tgetent'   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `tgetstr'   797:     binding file bash [0] to /lib/x86_64-linux-gnu/libtinfo.so.5 [0]: normal symbol `tgetflag'You can confirm from the output of nm -D /bin/bash that bash is using those symbols from tinfo.Bringing the man page for any of those symbols clarifies what they're for:$ man tgetentNAME   PC, UP, BC, ospeed, tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs -   direct curses interface to the terminfo capability databaseBasically, bash, more likely its readline (libreadline is statically linked in) editor, uses those to query the terminfo database to find out about terminal capabilities so it can run its line editor properly (sending the right escape sequences and identify key presses correctly) on any terminal.As to why readline is statically linked into bash, you have to bear in mind that readline is developed alongside bash by the same person and is included in the source of bash.It is possible to build bash to be linked with the system's installed libreadline, but only if that one is of a compatible version, and that's not the default. You need to call the configure script at compilation time with --with-installed-readline.