-3

It's really annoying, a user asked this question:

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?

I will admit my first answer wasn't amazing, so I edited it to the following:

/bin/sh is linked to /bin/dash for what I think is compatibility reasons. Many scripts simply start with

#!/bin/sh

so by moving to dash and not making a symbolic link, a lot of scripts would fail to run properly.

The change was made from bash to dash because according to https://wiki.ubuntu.com/DashAsBinSh:

The major reason to switch the default shell was efficiency. bash is an excellent full-featured shell appropriate for interactive use; indeed, it is still the default login shell. However, it is rather large and slow to start up and operate by comparison with dash. A large number of shell instances are started as part of the Ubuntu boot process. Rather than change each of them individually to run explicitly under /bin/dash, a change which would require significant ongoing maintenance and which would be liable to regress if not paid close attention, the Ubuntu core development team felt that it was best simply to change the default shell.

sh is not linked to bash, because

The Debian policy manual has long mandated that "shell scripts specifying '/bin/sh' as interpreter must only use POSIX features"

If you want to use bash as /bin/sh:

If the problems are more widespread and you want to change the default system shell back, then you can instruct the package management system to stop installing dash as /bin/sh:

sudo dpkg-reconfigure dash

There are some features that dash provides that bash does not, as:

there is even an outside chance that there are a few scripts that now depend on some feature of dash that bash does not provide!

And my answer still got downvoted after this change! What's wrong with this? I answer the question asked with quotes from an official source!!

  • Can you provide a link to the question please? – Android Dev Nov 16 '17 at 16:19
  • 2
    Maybe you just got bad luck: At first your answer wasn't that great, so somebody thought it would be worth a downvote. Later there were other answers that simply were better (Gilles just is a real pro IMO), so your answer got to the bottom of the page where next to nobody gets to. My advice for the next time: Write your answer as god as you can so that nobody has a reason to downvote it at any time. – dessert Nov 16 '17 at 19:11
  • +1 from me (i didn't get to see the original version) to help counteract. – user692175 Nov 17 '17 at 17:44
  • Why did this question get downvotes? – NerdOfLinux Nov 17 '17 at 23:39
  • 1
    @NerdOfLinux If you're talking about this meta question getting downvoted, then I don't know the reason, but (a) I've edited it so it's clearer, which I think should help, and (b) one of the purposes for which voting gets used here on meta is to express disagreement. Maybe readers interpreted this meta question as saying no answer that includes quotes from official sources should be voted down, and disagreed with that. Anyway, I think asking how one should act amidst downvotes, and what might have led to downvotes on a post, is a perfectly excellent use of meta. So I've posted an answer. – Eliah Kagan Nov 18 '17 at 6:16
  • Someone lost their keys. – Kaz Wolfe Nov 19 '17 at 2:29
6

First I'll try to answer the general question. Scroll down for my thoughts on the specific post.

If you know there is no reason at all for the downvotes, then the answer is to do nothing. Downvotes that are accidental or result from strange one-off misunderstandings of a post--that is, random downvotes--are more than made up for by upvotes in the long run. In terms of reputation points, upvotes outweigh downvotes even in the short run, because each upvote gives more rep than a downvote takes away, especially on answers.

The more interesting (and also more common) issue is what to do when a post is downvoted and you're not sure if there's a reason. I'll focus on answers here. These are the things I usually ask myself when I notice that an answer of mine has been downvoted and it's not immediately obvious why someone would have downvoted it:

  1. Are there comments on your answer explaining the downvotes? Could a comment that seemed like it wasn't even a criticism actually have been intended as one? Just as it is sometimes hard to write a good question or answer, it can be hard to write a good comment, too.

  2. Is there something wrong with your answer that is apparent by reading the question or the other answers, or maybe other posts that link to or from the post? Or that voters may think is apparent?

    While I find this explains a lot of downvotes, it's also important not to take things too far and assume there must be a clue somewhere. Sometimes an accidental or pointless downvote is just that and nothing more.

  3. Does the answer make claims that seem unusual, without explaining why they are true?

  4. Does the answer make claims that seem vague, without explaining what they mean?

  5. Are the downvotes coming in as part of what appears to be a concerted effort to abuse the system?

This isn't intended as an exhaustive list; it's just what I tend to think of, in the order I tend to think of them. And I'm a little reluctant to include #5, because it's different from the others: it's not obvious that I actually should be asking myself that question, except in unusual cases. Personal, spite-driven downvoting is probably rare, and when it happens the solution is either for the system to reverse it automatically or to inform a moderator in case there happens to be some action they can take. In contrast, 1-4 are all about the choices I have and the action I can choose to take.

Reasonable actions to take depending on the circumstances include editing, commenting, and posting on meta to get other people's views about the post and the situation, exactly as you have done here. Note that this is potentially useful precisely because the downvotes may not be random and pointless. And in this case, I don't think they were.


Your answer to "What is the point of sh being linked to dash?"

It seems to me that, even in its current state of revision, some combination of #3 and #4 apply.

As you say, you added quotes from an official source to your answer. That did improve your answer. But I don't think it's clear what exactly you are claiming, or how it could be supported by the quotes you used, when you say that you think /bin/sh is linked to /bin/dash for compatibility reasons. You correctly state that #!/bin/sh is frequently used as a hashbang line for shell scripts, and then you say:

so by moving to dash and not making a symbolic link, a lot of scripts would fail to run properly(or at all).

But that doesn't really make sense, because:

  • /bin/sh was already a symbolic link. The question is why it links to dash. It used to link to bash.
  • What would it even mean to move to dash without changing that symlink? The only thing I can think of is that you might be talking about expecting everybody to write #!/bin/dash instead of #!/bin/sh, and that you might be claiming that it is for "compatibility" that /bin/sh even still exists. I really cannot tell.

In a very weak sense, almost everything anyone ever does while using a computer is for compatibility reasons. If I drag a file icon from one folder window to another, that's for compatibility with the traditional way file browsers expect me to transfer files. If I enter a password, that's for compatibility with the authentication system. /bin/sh doesn't just exist for historical reasons. It is whatever "POSIX shell" the developers of a system intend for scripts to use, if those scripts' authors do not stipulate another shell.

Because "compatibility" can mean so many things, and because none of them seem to be supported by the quotes from official sources that you included in your post, it is not currently obvious what your post is actually saying, much less whether or not it is true. You don't have to edit your post further if you don't want to, but if you choose to do so, then I would encourage you to replace "for what I think is compatibility reasons" with something clear and specific, and then make sure that claim is fully and clearly supported by your sources.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .