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 does dash
. Busybox ash
does, so if you must an ash
variant for some reason and have line editing, etc., use Busybox ash
. Nobody's going to bother with adding readline support, since dash
'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:
-V vi Enable the built-in vi(1) command line editor
(disables -E if it has been set).
-E emacs Enable the built-in emacs(1) command line editor
(disables -V if it has been set).
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:
git clone https://git.kernel.org/pub/scm/utils/dash/dash.git
cd dash
./autogen.sh
./configure --with-libedit
make
Then run:
src/dash -E
You should be able to use the arrow keys to edit the current command.