In bash or mksh it is possible to move around the typed line word by word, using shortcuts such as ESCB.
That doesn't work in ksh or dash. As far as I understand from googling, this has something to do with readline support, however nowhere I've seen it mention how to enable support for dash.
That's the core of my question: How to enable line navigation for dash
If you definitely want
dash
plus command-line editing and history, you can userlwrap
:Suggestion:
To use
rlwrap
, you'll have to:The short answer is:
You don't.
dash
is a direct descendent of the Almquist Shell (ash
).ash
never featured line editing support, and neither doesdash
. Busyboxash
does, so if you must anash
variant for some reason and have line editing, etc., use Busyboxash
. Nobody's going to bother with adding readline support, sincedash
's primary use is for running shell scripts.Unless, of course, you're willing to code support for readline in
dash
, and maintain such a patch yourself...The long answer is:
Compile with
libedit
If you look at
dash
's manpage:These only work if
dash
was compiled with--with-libedit
. It isn't, neither in Ubuntu, nor, apparently, in Debian.You can build it thus:
Then run:
You should be able to use the arrow keys to edit the current command.