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


Groups > linux.debian.user > #166775

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

From Gene Heskett <gheskett@shentel.net>
Newsgroups linux.debian.user
Subject Re: Script doesn't work when it is run using '#!/bin/sh'
Date 2016-04-16 17:40 +0200
Message-ID <roAud-5LI-1@gated-at.bofh.it> (permalink)
References <roxwl-3jH-5@gated-at.bofh.it> <roy93-3Uq-9@gated-at.bofh.it> <rozHQ-50s-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Saturday 16 April 2016 10:47:24 Aero Maxx wrote:

> On 16/04/2016 14:08, tomas@tuxteam.de wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Sat, Apr 16, 2016 at 01:22:09PM +0100, Aero Maxx wrote:
> >> I have a number of bash scripts that work perfectly fine on fedora
> >> 23, but do not work on debian 8.  I've tried to sort it out myself,
> >> but am a little stuck now hopefully someone is able to give me a
> >> nudge in the right direction.
> >> The output I get from the above script is
> >>
> >>> wordpress_beta.sh: 8: bashtest.sh: [[: not found
> >>> wordpress_beta.sh: 8: bashtest.sh: web: not found
> >>> wordpress_beta.sh: 8: bashtest.sh: web: not found
> >>>
> >>> Setting current directory to 'web' web public folder.
> >
> > The [[ is correct bash syntax. To try to pinpoint the problem, try
> > running the script with "bash <script>". If you don't want to run
> > the script but just to check syntax, you might want to try
> > "bash -n <script>".
> >
> > If that works out OK, perhaps your script is still being invoked
> > under dash?
>
> I tried that it works thank you, I mistaken assumed that because I
> changed the shebang line to be bash instead of sh,
> and then ran it using "sh <script>" it would work, but obviously I got
> the same errors as before, and I wasn't aware that
> there was one called bash also, but now I think of it that's quite
> obvious.
>
> Anyway thank you to everyone that responded to my message!
>
FWIW, bash I believe, is the grey haired old man in the shell arena, I 
was using it way back in my amiga days as someone had apparently ported 
it to amigados 2 decades and change ago.  We also had ksh and csh, but 
they didn't have the power of bash or ARexx.  And I still miss ARexx. 
Even bash cannot do the intimate to the os things that ARexx could do.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

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