Professional Web Applications Themes

6.10 defaults to "dash" for shell? - Ubuntu

Lurking on the SCOX Investor Village board, I came across this comment (in message 17268): A handy tip for Ubuntu users; sudo bash This will give you a bash shell as root. This is especially useful with Ubuntu 6.10, as it was decided that the default shell for this version should be dash, as it is smaller and faster (apparently). I don't have a *ubuntu system immediately at hand, and can't directly look at this, so any polite comments appreciated (it's news to me). -- Regards, Weird (Harold Stevens) * IMPORTANT EMAIL INFO FOLLOWS * Pardon any bogus email addresses ...

  1. #1

    Default 6.10 defaults to "dash" for shell?

    Lurking on the SCOX Investor Village board, I came across this comment (in
    message 17268):

    A handy tip for Ubuntu users;
    sudo bash
    This will give you a bash shell as root. This is especially useful
    with Ubuntu 6.10, as it was decided that the default shell for this
    version should be dash, as it is smaller and faster (apparently).

    I don't have a *ubuntu system immediately at hand, and can't directly look
    at this, so any polite comments appreciated (it's news to me).

    --
    Regards, Weird (Harold Stevens) * IMPORTANT EMAIL INFO FOLLOWS *
    Pardon any bogus email addresses (wookie) in place for spambots.
    Really, it's (wyrd) at airmail, dotted with net. DO NOT SPAM IT.
    Kids jumping ship? Looking to hire an old-school type? Email me.
    Harold Guest

  2. #2

    Default Re: 6.10 defaults to "dash" for shell?

    On Thu, 11 Jan 2007 19:28:30 +0000, Harold Stevens wrote:
     

    It's true:

    $ ls -l /bin | grep sh
    -rwxr-xr-x 1 root root 661K 2006-09-19 16:24 bash
    -rwxr-xr-x 1 root root 79K 2006-07-11 13:31 dash
    lrwxrwxrwx 1 root root 4 2006-12-22 18:53 rbash -> bash
    lrwxrwxrwx 1 root root 4 2006-12-22 18:53 sh -> dash
    lrwxrwxrwx 1 root root 4 2006-12-22 18:53 sh.distrib -> bash

    Personally, I like the change, but it obviously helps to know about it.
    I've only found a couple of scripts that broke with dash, and the breakage
    is pretty obvious. IMHO, bash is gross overkill to use simply for
    executing shell scripts.

    -ts
    ts Guest

  3. #3

    Default Re: 6.10 defaults to "dash" for shell?

    On Thu, 11 Jan 2007 21:40:47 -0600, ts wrote:
     

    It seems to run .bashrc .bash_profile whatever anyway.

    --
    Chris Game

    "Not everything that can be counted counts, and not everything
    that counts can be counted." - Albert Einstein

    Chris Guest

  4. #4

    Default Re: 6.10 defaults to "dash" for shell?

    In <net> Chris Game:

    [Snip...]
     

    FWIW, this message (Investor Village SCOX # 17268) also mentions:

    causes problems for some shell scripts that make the assumption that
    /bin/sh points to bash - an incorrect, though prevalent, assumption

    Just a "headsup" for anyone needing shell scripts to run as expected...

    HTH, YMMV...

    --
    Regards, Weird (Harold Stevens) * IMPORTANT EMAIL INFO FOLLOWS *
    Pardon any bogus email addresses (wookie) in place for spambots.
    Really, it's (wyrd) at airmail, dotted with net. DO NOT SPAM IT.
    Kids jumping ship? Looking to hire an old-school type? Email me.
    Harold Guest

  5. #5

    Default Re: 6.10 defaults to "dash" for shell?

    On Fri, 12 Jan 2007 11:03:39 +0000, Chris Game wrote:
     
    >
    > It seems to run .bashrc .bash_profile whatever anyway.[/ref]

    Only if you don't use any "bashisms" in your .bashrc or .bash_profile,
    obviously.

    -ts
    ts Guest

  6. #6

    Default Re: 6.10 defaults to "dash" for shell?

    Harold Stevens <localdomain> wrote:
     

    The author is mixing two different things here:

    1. In Ubuntu 6.10 /bin/sh is a symlink to dash, not bash as before.

    2. But "sudo -s" still starts the shell specified in $SHELL and "sudo -i"
    still starts the shell in root's passwd entry (maybe this is /bin/sh
    by default - I don't know as I changed it).



    Florian
    --
    <http://www.florian-diesch.de/>
    Florian Guest

  7. #7

    Default Re: 6.10 defaults to "dash" for shell?

    On Fri, 12 Jan 2007 21:16:24 -0600, ts wrote:
     
    >>
    >> It seems to run .bashrc .bash_profile whatever anyway.[/ref]
    >
    > Only if you don't use any "bashisms" in your .bashrc or .bash_profile,
    > obviously.[/ref]

    Hmm, interestingly my /etc/passwd file says I'm using /bin/bash as does
    the output from the 'help' command...

    --
    Chris Game

    "If at first the idea is not absurd, then there is no hope for it."
    -- Albert Einstein

    Chris Guest

  8. #8

    Default Re: 6.10 defaults to "dash" for shell?

    On Thu, 11 Jan 2007 19:28:30 +0000, Harold Stevens wrote:
     


    I don't like it. Some of my old shell scripts wouldn't work under dash.
    I set my terminal back to bash.

    Jon Guest

  9. #9

    Default Re: 6.10 defaults to "dash" for shell?

    On Sat, 13 Jan 2007 13:55:05 -0700, Jon wrote:
     
    >
    >
    > I don't like it. Some of my old shell scripts wouldn't work under dash.
    > I set my terminal back to bash.[/ref]

    If your shell scripts require bash, they really should begin with
    #!/bin/bash instead of #!/bin/sh. Otherwise, they won't be portable, as
    you've discovered.

    -ts
    ts Guest

  10. #10

    Default Re: 6.10 defaults to "dash" for shell?

    On Sat, 13 Jan 2007 19:49:58 -0600, ts wrote:
     

    No. That's the opposite of portable. POSIX requires there to be a
    "/bin/sh", but there may be no bash at all. The portable idea is that one
    has a symlink and the shell behaves as the Bourne shell when called as
    "sh". This means that the same script can run under Linux, Unix, BSD, etc.

    Of course, this falls flat on the ground when a distro uses a shell that
    doesn't correctly emulate "sh", but whose fault is that?

    mark Guest

  11. #11

    Default Re: 6.10 defaults to "dash" for shell?

    mark south enlightened us with: 
    >
    > No. That's the opposite of portable. POSIX requires there to be a
    > "/bin/sh", but there may be no bash at all.[/ref]

    But still, if the script _requires_ bash, it should link to bash.
     

    But then the script would have to be written for the Bourne shell, not
    the Bourne Again shell, wouldn't it?

    Sybren
    --
    Sybren Stüvel
    Stüvel IT - http://www.stuvel.eu/
    Sybren Guest

  12. #12

    Default Re: 6.10 defaults to "dash" for shell?

    On Tue, 16 Jan 2007 20:48:32 +0100, Sybren Stuvel wrote:
     
    >>
    >> No. That's the opposite of portable. POSIX requires there to be a
    >> "/bin/sh", but there may be no bash at all.[/ref]
    >
    > But still, if the script _requires_ bash, it should link to bash.

    >
    > But then the script would have to be written for the Bourne shell, not
    > the Bourne Again shell, wouldn't it?
    >
    > Sybren[/ref]

    I would think it could link think to either Bourne or Bourne Again.

    Jon Guest

  13. #13

    Default Re: 6.10 defaults to "dash" for shell?

    Jon wrote: 
    >>
    >> But still, if the script _requires_ bash, it should link to bash.
    >> 
    >>
    >> But then the script would have to be written for the Bourne shell, not
    >> the Bourne Again shell, wouldn't it?
    >>
    >> Sybren[/ref]
    >
    > I would think it could link think to either Bourne or Bourne Again.
    >[/ref]
    If you use a #!/bin/sh shebang, then you have no right to assume bash
    extensions (regardless of whether /bin/sh really is bash or not). This
    is what you should do if you want portability. If you don't care about
    portability and really want to make use of bash extensions, you should
    use #!/bin/bash (on a GNU system - on non-GNU systems containing bash,
    more likely #!/usr/local/bin/bash).

    - Will
    Will Guest

  14. #14

    Default Re: 6.10 defaults to "dash" for shell?

    On Tue, 16 Jan 2007 18:18:03 +0100, mark south wrote:
     
    >
    > No. That's the opposite of portable. POSIX requires there to be a
    > "/bin/sh", but there may be no bash at all. The portable idea is that one
    > has a symlink and the shell behaves as the Bourne shell when called as
    > "sh". This means that the same script can run under Linux, Unix, BSD,
    > etc.[/ref]

    You missed the part that read, "If your shell scripts require bash"... I
    agree that a correctly written Bourne shell script is more portable than a
    Bash script, that's not the topic being discussed.

    -ts
    ts Guest

  15. #15

    Default Re: 6.10 defaults to "dash" for shell?

    On Wed, 17 Jan 2007 01:10:05 +0000, Will Parsons wrote:
     
    >>
    >> I would think it could link think to either Bourne or Bourne Again.
    >>[/ref]
    > If you use a #!/bin/sh shebang, then you have no right to assume bash
    > extensions (regardless of whether /bin/sh really is bash or not). This
    > is what you should do if you want portability. If you don't care about
    > portability and really want to make use of bash extensions, you should
    > use #!/bin/bash (on a GNU system - on non-GNU systems containing bash,
    > more likely #!/usr/local/bin/bash).[/ref]

    Exactly the point I was trying to make - thanks. If you write a Bash
    script, you should ensure that it is invoked by bash. Writing a bash
    script and expecting /bin/sh to understand it is just plain broken.

    -ts
    ts Guest

  16. #16

    Default Re: 6.10 defaults to "dash" for shell?

    On Tue, 16 Jan 2007 22:27:58 -0600, ts wrote:
     

    Indeed. But writing bash and requiring bash alone is clearly a different
    meaning of "portable" from the one I am accustomed to, and more in line
    with the "embrace, extend, extinguish" philosophy of "portability".

    mark Guest

  17. #17

    Default Re: 6.10 defaults to "dash" for shell?

    On Wed, 17 Jan 2007 19:33:35 +0100, mark south wrote:
     
    >
    > Indeed. But writing bash and requiring bash alone is clearly a different
    > meaning of "portable" from the one I am accustomed to, and more in line
    > with the "embrace, extend, extinguish" philosophy of "portability".[/ref]

    I'm not advocating writing scripts that depend on bash-specific syntax,
    merely accepting that they exist. Now, back to the original topic.
    Assume you have two bash-specific scripts, one which starts with #!/bin/sh
    and one which starts with #!/bin/bash. Which one is more portable?

    -ts
    ts Guest

  18. #18

    Default Re: 6.10 defaults to "dash" for shell?

    On Wed, 17 Jan 2007 20:36:55 -0600, ts wrote:
     
    >>
    >> Indeed. But writing bash and requiring bash alone is clearly a different
    >> meaning of "portable" from the one I am accustomed to, and more in line
    >> with the "embrace, extend, extinguish" philosophy of "portability".[/ref]
    >
    > I'm not advocating writing scripts that depend on bash-specific syntax,
    > merely accepting that they exist. Now, back to the original topic.
    > Assume you have two bash-specific scripts, one which starts with #!/bin/sh
    > and one which starts with #!/bin/bash. Which one is more portable?[/ref]

    Neither, in any normal sense of the term "portable". They will BOTH only
    work with bash. However, only the latter is correctly coded, since it can
    reasonably be expected to run, while the other is reasonably expected to
    fail.

    Now let's drop this. You can go off and learn about portability and I can
    go out to get my lunchtime martini.
    mark Guest

  19. #19

    Default Re: 6.10 defaults to "dash" for shell?

    On Thu, 18 Jan 2007 12:04:41 +0100, mark south wrote:
     

    Drunk, rude, and ignorant is no way to go through life. You have my
    sympathies.

    -ts
    ts Guest

Similar Threads

  1. "Text import options > Set Dictionary to:" defaults to Neutral
    By Olivier_Berquin@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 9
    Last Post: December 7th, 08:33 PM
  2. Source code for "syslog()" and "open" command shell
    By Alain in forum Mac Programming
    Replies: 3
    Last Post: January 2nd, 03:03 AM
  3. Curves Defaults Won't "Stick"
    By LibbyS in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 0
    Last Post: August 12th, 04:20 PM
  4. Replies: 1
    Last Post: July 21st, 03:00 AM
  5. Replies: 2
    Last Post: July 11th, 04:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139