You are not logged in.
Pages: 1
I read about dash at https://wiki.archlinux.org/title/Dash
It says 4 times faster than bash, great. So I installed it and tested scripts using it explicitly like
#!/usr/bin/dashIt works and great. Very smooth.
But I still wonder should I use dash while my shell is bash?
I don't want to relink /bin/sh to dash because I'm not very advanced so I couldn't fix if something is messed up.
And is there any benefit of using dash scripting my things like dwm status, battery monitoring loop, checking reminders, etc... while my shell is bash because it is like running another program unnecessarily?
Or can it be bad technically?
Offline
But I still wonder should I use dash while my shell is bash?
That is a question only you can answer for yourself and depends on waht you expect from your shell.
You can change your default shell to be dash and see for yourself.
I don't want to relink /bin/sh to dash ...
Good while on paper all scripts using the #!/bin/sh shebang should only use POSIX feature set in practice this is often misused and should be reported as an upstream bug.
...running another program unnecessarily?
Executed scripts invoke their specified command in a new process, so as far as I know there is no difference between using another shell inside a running shell session.
Or can it be bad technically?
No but dash does come with a limited feature set compared to more fleshed out shells (bash/zsh). So if you need more performant scripts go for it, you can always change them back.
Also there are some good resources for shell scripting online and in this forum (look in the programming section) as a lot of performance can be gained by using the shell and associated tools correctly.
Offline
... because it is like running another program unnecessarily?
And which program is that exactly? Yes, running a dash script runs dash. But if it were a bash script, it'd run bash. One or the other is "necessary". So the question is which is more efficient.
FYI, busybox's ash will beat dash on most metrics of speed and low resource use - especially if you enable all the builtins (sed, grep, awk ...) so these are never called as external programs. I use ash for everything and have re-linked /bin/sh to ash.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1