(   )
                          (    )
                           (    )
                          (    )
                            )  )
                           (  (                  /\
                            (_)                 /  \  /\
                    ________[_]________      /\/    \/  \
           /\      /\        ______    \    /   /\/\  /\/\
          /  \    //_\       \    /\    \  /\/\/    \/    \
   /\    / /\/\  //___\       \__/  \    \/
  /  \  /\/    \//_____\       \ |[]|     \
 /\/\/\/       //_______\       \|__|      \
/      \      /XXXXXXXXXX\                  \
        \    /_I_II  I__I_\__________________\
               I_I|  I__I_____[]_|_[]_____I
               I_II  I__I_____[]_|_[]_____I
               I II__I  I     XXXXXXX     I
            ~~~~~"   "~~~~~~~~~~~~~~~~~~~~~~~~

Sun, 13 Sep 2009

Using Rlwrap to Keep Your Commandline Sanity

After many years of commandline use, I've gotten spoiled by the pervasiveness of GNU readline in shells and other shell-like apps, like the MySQL shell. When I do sit down and try to use an app without such support, the result is a fairly painful mix of cursing and visible control characters (Oracle's sqlplus interface is probably the poster child for miserable CLI experiences, with no convenience facilities whatsoever).

An easy way around this is to use rlwrap, a nifty little program that gives any badly-designed CLI interface full readline capabilities, including command history, searching and editing. Most Linux distros have packages for it, but if not, just download and install the source yourself. It's not very large, and can be installed in a local bin directory if needed. Then you do something like rlwrap sqlplus FOO/password@db1 @sql/settings.sql or rlwrap mailx. Enjoy!

posted at: 14:36 | path: / | permalink | Linux, Rlwrap, Sysadmin, Tips, Unix