Entry submitted by arno. DPOTD needs your help, please contribute !
Many command-line-oriented applications don’t provide features like history, completion or line-editing. rlwrap wraps readline (which is the library behind those features in bash and many other applications) around any line-oriented command. So you can take advantage of history, completion and editing facilities, even with applications that don’t provide them. rlwrap is the kind of tool that, once discovered, makes you wonder how you could have lived without it.
For example, telnet or netcat don’t have editing facilities, neither history. With rlwrap, system administrators will then be able to use those tools more efficiently. Also, launching dash can sometimes help testing compatibility for a few lines of shell code. Unfortunately, line editing with dash is not very pleasant. With rlwrap, it becomes possible to have completion and history in dash.
By default, history is saved in a specific file for each program: your history will be kept even after exiting the program, and will not conflict with other apps.
Just as readline, you can customize rlwrap with ~/.inputrc file. You can also define, for each application, a list of keywords. rlwrap will then perform completion on those words.
With socat, you can also wrap readline around any program. Socat is much more than a readline wrapper: using it only for that purpose would be not only overkill, but also more complex. Another readline wrapper is cle (Command Line Editor). It’s a great tool, but it has not been developed since 1999. Rlwrap is now more powerful, providing more options, with more configuration capabilities.
Users of applications such as netcat, telnet, dc, that don’t link with readline, and whose editing possibilities are limited.
If your shell supports it, you may find useful to define aliases for commands you often use ; for example:
alias netcat="rlwrap netcat".
You can find rlwrap’s homepage at http://utopia.knoware.nl/~hlub/uck/rlwrap/
rlwrap is available in Debian (0.21-1 in sarge, 0.28-2 in unstable) and Ubuntu (0.24-1 in dapper and edgy).