Is it possible to get at least "some" autocompletion in a
dash shell like in
At least for the existing filenames in a path.
No, dash doesn't have completion. Otherwise it would be called bash. Dash was designed to execute shell scripts fast and with a minimum of memory, it wasn't intended to be used interactively.
The best way to get completion in dash is to run
exec zsh or
exec fish. Or, if you want to stick with a shell that doesn't use much memory, use a BusyBox sh build that includes completion.
If you want to stick with dash, you can do what people did before completion existed: use wildcards. For example, instead of typing a prefix of a file name and then pressing Tab, type a prefix of a file name and then type
*. The prefix needs to be unique, otherwise multiple file names will be interpolated.
To list “completions”, call
ls or run
echo on the wildcard pattern.
If you use the same file name (or other string) multiple times, store it in a variable.
Suggesting an alternative (@...)
dash? for me is the resident memory usage. (I use yakuake and each bash tab is 34MB here. dash is 708KB.) The problem is I am often typing bash to have autocompletion.
yash RSS=1080KB, has excellent auto-completion (may be even friendlier than bash's one). I set it as default on yakuake and no matter how many tabs I open it is very easy on memory.
I found that having yakuake start yash with
.yashrc starting bash uses +-9MB RSS instead of 34MB! then if I want to keep something like htop, i just exit bash and get the yash low memory again to run it!
exec zsh used 5.5MB RSS (...@) as you may not want to stick with dash :)
Obs.: RSS thru