LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems for using dash (https://www.linuxquestions.org/questions/linux-newbie-8/problems-for-using-dash-4175645387/)

shlomo.hovir 01-02-2019 02:10 PM

problems for using dash
 
i want to use dash as a default shell but my main problem i want to get previous commands when clicking up arrow i can't how to do it
bash does that but i noticed all other shells don't support that

ehartman 01-02-2019 03:51 PM

Quote:

Originally Posted by shlomo.hovir (Post 5943940)
bash does that but i noticed all other shells don't support that

I'm not sure about ksh (it does support history but I'm no export in how) but tcsh most certainly does.

And dash is not really meant to be an interactive shell, because supporting features like that would make it into another bash. The main advantage of dash is that it's much smaller, ensuring a much lower STARTUP time in scripts, but this does mean that it has omitted many features that enhance interactive use. After the startup time, mostly due to its size and initialization, bash is just as fast as dash.

Normally you make your login shell bash (or tcsh) but create a symbolic link from /bin/dash to /bin/sh, so that by default scripts will use dash instead.
You can still explicit run scripts with bash then by using as first line of that script
Code:

#!/bin/bash
A login (or terminal window) shell is only started once, a shell script has to start a new shell for each script executed or recursively called. And they are not using interactive features (like history) anyway, so the lack of them isn't important.


All times are GMT -5. The time now is 06:22 AM.