Questions tagged [dash-shell]

Lightweight command-line shell, used as the default /bin/sh on Ubuntu

Dash is a lightweight shell, used as the default /bin/sh on Ubuntu. It is an alternative to , which is the default login shell (e.g. when opening a terminal from the GUI).

See also

64 questions
85
votes
4 answers

What is the point of sh being linked to dash?

I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh. Or if anything why isn't sh linked to bash?
NerdOfCode
  • 2,608
15
votes
2 answers

How to find the version of the Dash shell on Ubuntu /bin?

I would like to know if there is a way for find the shell Dash version. I tried several commands like : dash -v, dash -V, dash --version, but no one works. Dash Shell Wikipedia : http://en.wikipedia.org/wiki/Debian_Almquist_shell
PierreP
  • 153
13
votes
3 answers

How can my script determine whether it's being run by bash or dash?

I'm running a fresh Oneiric install (i.e. not an upgrade) on two different systems and running into the same set of seemingly related problems. The most frustrating of the bunch is that, when I use the .profile and .bashrc that I have carried with…
11
votes
3 answers

Why are numeric function names not allowed?

Consider the following: $ ksh -c '1(){ echo hi;};1' ksh: 1: invalid function name $ dash -c '1(){ echo hi;};1' dash: 1: Syntax error: Bad function name $ bash -c '1(){ echo hi;};1' bash: `1': not a valid identifier bash: 1: command not found $ mksh…
11
votes
1 answer

What are syntax differences between bash and dash?

I just realized that in current Ubuntu version /bin/sh is no more symlinked to bash (as it used to be for many years), but to dash instead. I wonder what are the actual syntax differences between those two shells and how big is the probability that…
raj
  • 11,409
11
votes
2 answers

How Can I Make /bin/sh point to /bin/bash?

In Ubuntu, /bin/sh points to /bin/dash by default. I want to use /bin/bash as my system-wide shell for /bin/sh. What is the best way to do this?
mkasberg
  • 1,474
10
votes
2 answers

Why doesn't auto complete work in my shell?

I am not so into Linux and I have the following doubts: a client provided me an Ubuntu 18.04.3 LTS virtual machine which I access via SSH. (I am using MobaxTerm as SSH client but it should not be the problem.) The shell used is sh. The problem is…
AndreaNobili
  • 4,839
10
votes
2 answers

How does ~/ work?

In the terminal, one way to reference home is by using ~/. I don't understand how this works, because the output of file ~/ is: /home/admin/: directory and just running ~/ results in: -bash: /home/admin/: Is a directory so what's converting ~/…
user8292439
  • 3,878
  • 7
  • 32
  • 57
9
votes
2 answers

Line editing in dash

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…
8
votes
1 answer

Are there concrete figures on the speed of bash vs dash?

According to this article, dash was chosen as /bin/sh because bash is slower: Dash as /bin/sh Are there concrete figures for how much faster dash is? How much longer does it take if you use bash instead of dash to boot Ubuntu? Do the arguments of…
guettli
  • 1,765
7
votes
1 answer

How to concatenate two command in shell

I used to have this command to count how many times I have click with a mouse, the command is xev | grep "ButtonPress". my colleague modify the command so that it return: ButtonPress 0 ButtonPress 1 ButtonPress 2 ButtonPress 3 and so on...…
6
votes
1 answer

vi editing mode in dash ( /bin/sh )

TL;DR : default shell man page says there's vi editing mode, but set -o vi doesn't actually enable it In many shells, including dash the POSIX standard dictates that set -o vi will enable vi editing mode, in which user of interactive shell can…
4
votes
1 answer

What's the difference between system shell and login shell?

I recently encountered that my /bin/sh is a symlink to dash, which is apparently default system shell for ubuntu since its 6.10 release. I didn't know system shell is different from login shell. I can intuitively guess what the role of system shell…
aamir
  • 151
4
votes
2 answers

How to replace/fix a messed up /bin/sh and /bin/dash

I have corrupted my /bin/sh and have no idea how to replace it. I accidentally copied over it. How can I fix this? I am running Ubuntu Server 11.10, no X. update: I have tried the fix that was kindly offered by Eliah but i think i copied over…
Joel
  • 41
  • 1
  • 1
  • 4
4
votes
2 answers

How do I use command-line arguments to `sh` in the `-c` command string?

I know that sh -c 'echo $1' sh 4 will output 4. and sh -c 'echo $2' sh 4 5 will output 5. But I cannot understand how the parameters after the second sh were passed to the command next to sh -c. I read the man page of both bash and dash but could…
1
2 3 4 5