Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #166772

Re: Script doesn't work when it is run using '#!/bin/sh'

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: Script doesn't work when it is run using '#!/bin/sh'
Date 2016-04-16 16:30 +0200
Message-ID <rozov-4QQ-31@gated-at.bofh.it> (permalink)
References <roy93-3Uq-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Aero Maxx wrote:
> >wordpress_beta.sh: 8: bashtest.sh: [[: not found

If it is called "bashtest.sh" then it is plausible that it wants
to be run by bash. Obviously it expects /bin/sh to be bash.


tomas@tuxteam.de wrote:
> try running the script with "bash <script>". [...]
> If that works out OK, perhaps your script is still being invoked
> under dash?

Or perhaps its parent invokes it by /bin/sh on its own ?


I wonder whether bash is guaranteed to offer all features of dash.
In that case one could revert the migration of /bin/sh to dash and
hope that all dash scripts continue to work.

If compatibility with Fedora is an essential goal, it might be worth
to risk potential dash expectation problems.

On my system i see the link  /bin/sh -> dash
For a quick test i'd do:

  rm /bin/sh
  ln -s bash /bin/sh

On
  https://wiki.ubuntu.com/DashAsBinSh
i see this advise:

  sudo dpkg-reconfigure dash

(But i fail to see this purpose promised in man dpkg-reconfigure.)


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Script doesn't work when it is run using '#!/bin/sh' Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 14:30 +0200
  Re: Script doesn't work when it is run using '#!/bin/sh' <tomas@tuxteam.de> - 2016-04-16 15:10 +0200
    Re: Script doesn't work when it is run using '#!/bin/sh' David Wright <deblis@lionunicorn.co.uk> - 2016-04-16 16:20 +0200
    Re: Script doesn't work when it is run using '#!/bin/sh' "Thomas Schmitt" <scdbackup@gmx.net> - 2016-04-16 16:30 +0200
    Re: Script doesn't work when it is run using '#!/bin/sh' Aero Maxx <aero.maxx.d@gmail.com> - 2016-04-16 16:50 +0200
      Re: Script doesn't work when it is run using '#!/bin/sh' Gene Heskett <gheskett@shentel.net> - 2016-04-16 17:40 +0200
        Re: Script doesn't work when it is run using '#!/bin/sh' Jeremy Nicoll <jn.ml.dbn.25@letterboxes.org> - 2016-04-16 22:40 +0200
          Re: Script doesn't work when it is run using '#!/bin/sh' Gene Heskett <gheskett@shentel.net> - 2016-04-17 01:20 +0200
      Re: Script doesn't work when it is run using '#!/bin/sh' <tomas@tuxteam.de> - 2016-04-17 18:00 +0200

csiph-web