Thread

  1. Is `#!/bin/sh' configurable?

    Alexander Klimov <ask@wisdom.weizmann.ac.il> — 2001-05-08T15:29:38Z

    Hi.
    
    On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    there is /bin/sh5. It is looks like there is already knowledge about it in
    the system: Makefile.ultrix4 has `SHELL=/bin/sh5' in it, but configure
    thinks something else: config.status has `s%@SHELL@%/bin/sh%g'. (This is
    really unrelated, because `src/bin/initdb/initdb.sh' has `#! /bin/sh'
    hardcoded in it)
    
    The result of the mess is that scripts like initdb are installed with
    `#!/bin/sh', but they has function definition and tcsh complain about
    usage of '('. 
    
    BTW: After hand substitution I reach the point of 
    IpcSemaphoreCreate: semget(key=4, num=17, 03600) failed: No space left on
    device
    The problem is that I have no idea how to enlarge the parameters on
    `ULTRIX black 4.3 1 RISC', and it is looks like PG has no FAQ for
    it. Anybody knows how to do it?
    
    Regards,
    ASK
    
    
    
    
  2. Re: Is `#!/bin/sh' configurable?

    Doug McNaught <doug@wireboard.com> — 2001-05-08T16:14:03Z

    Alexander Klimov <ask@wisdom.weizmann.ac.il> writes:
    
    > Hi.
    > 
    > On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    
    *violent retching sounds*
    
    IMHO, any system where /bin/sh doesn't point to an at-least-somewhat
    Bourne-compatible shell is broken by definition...  Who perpetrated
    this atrocity?
    
    -Doug
    -- 
    The rain man gave me two cures; he said jump right in,
    The first was Texas medicine--the second was just railroad gin,
    And like a fool I mixed them, and it strangled up my mind,
    Now people just get uglier, and I got no sense of time...          --Dylan
    
    
  3. Re: Is `#!/bin/sh' configurable?

    Bruce Momjian <pgman@candle.pha.pa.us> — 2001-05-08T16:28:08Z

    > Hi.
    > 
    > On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    > there is /bin/sh5. It is looks like there is already knowledge about it in
    > the system: Makefile.ultrix4 has `SHELL=/bin/sh5' in it, but configure
    > thinks something else: config.status has `s%@SHELL@%/bin/sh%g'. (This is
    > really unrelated, because `src/bin/initdb/initdb.sh' has `#! /bin/sh'
    > hardcoded in it)
    
    Actually, Makefile.ultrix will override what is in config.status, so
    that part is OK.
    
    > 
    > The result of the mess is that scripts like initdb are installed with
    > `#!/bin/sh', but they has function definition and tcsh complain about
    > usage of '('. 
    
    It is hard to feel sorry for OS's that have /bin/sh as something that is
    not at least moderately compatible with the Bourne sh.
    
    However, I am applying the following patch to allow SHELL set in
    Makefile.* to control what is used by initdb.  I have not changed any
    other commands because I don't want to start making this change all over
    when it is not necessary.
    
    > BTW: After hand substitution I reach the point of 
    > IpcSemaphoreCreate: semget(key=4, num=17, 03600) failed: No space left on
    > device
    > The problem is that I have no idea how to enlarge the parameters on
    > `ULTRIX black 4.3 1 RISC', and it is looks like PG has no FAQ for
    > it. Anybody knows how to do it?
    
    Sorry, I don't know.
    
    -- 
      Bruce Momjian                        |  http://candle.pha.pa.us
      pgman@candle.pha.pa.us               |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
    
  4. Re: Is `#!/bin/sh' configurable?

    Peter Eisentraut <peter_e@gmx.net> — 2001-05-08T16:55:37Z

    Alexander Klimov writes:
    
    > On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    > there is /bin/sh5.
    
    /bin/sh is a Bourne shell on Ultrix, just a particularly old and wacky
    one.
    
    > It is looks like there is already knowledge about it in
    > the system: Makefile.ultrix4 has `SHELL=/bin/sh5' in it, but configure
    > thinks something else: config.status has `s%@SHELL@%/bin/sh%g'.
    
    Autoconf inserts this automatically because some makes inherit the value
    of SHELL from the environment, which is a silly thing to do.  We don't use
    this because we use GNU make.
    
    > The result of the mess is that scripts like initdb are installed with
    > `#!/bin/sh', but they has function definition and tcsh complain about
    > usage of '('.
    
    No, the Ultrix shell simply doesn't support shell functions.  AFAIK it's
    the only Bourne shell still on the planet that does that.  The short
    answer might be not to use shell functions.  The one in initdb could
    probably be replaced by a trap.  But the Ultrix /bin/sh is broken in
    subtle and weird ways beyond that and it's too much effort to work around
    this.  Even the autoconf guys think so these days.
    
    A better answer would probably be making the #! /bin/sh substitutable.
    
    -- 
    Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
    
    
    
  5. Re: Is `#!/bin/sh' configurable?

    Alexander Klimov <ask@wisdom.weizmann.ac.il> — 2001-05-10T09:51:08Z

    On 8 May 2001, Doug McNaught wrote:
    
    > Alexander Klimov <ask@wisdom.weizmann.ac.il> writes:
    > 
    > > Hi.
    > > 
    > > On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    > 
    > *violent retching sounds*
    > 
    > IMHO, any system where /bin/sh doesn't point to an at-least-somewhat
    > Bourne-compatible shell is broken by definition...  Who perpetrated
    > this atrocity?
    
    Sorry, I was misleaded by
    >sh -c 'echo $SHELL'
    /bin/tcsh
    
    The /bin/sh is sh, but not SysV compatible -- there is /bin/sh5 for that.
    
    Regards,
    ASK
    
    
    
  6. Re: Re: Is `#!/bin/sh' configurable?

    Bruce Momjian <pgman@candle.pha.pa.us> — 2001-05-10T13:39:44Z

    We worked around the Ultrix /bin/sh problem for initdb.  If that is the
    only place there is a problem, we can keep the fix for 7.2.
    
    
    > On 8 May 2001, Doug McNaught wrote:
    > 
    > > Alexander Klimov <ask@wisdom.weizmann.ac.il> writes:
    > > 
    > > > Hi.
    > > > 
    > > > On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
    > > 
    > > *violent retching sounds*
    > > 
    > > IMHO, any system where /bin/sh doesn't point to an at-least-somewhat
    > > Bourne-compatible shell is broken by definition...  Who perpetrated
    > > this atrocity?
    > 
    > Sorry, I was misleaded by
    > >sh -c 'echo $SHELL'
    > /bin/tcsh
    > 
    > The /bin/sh is sh, but not SysV compatible -- there is /bin/sh5 for that.
    > 
    > Regards,
    > ASK
    > 
    > 
    > ---------------------------(end of broadcast)---------------------------
    > TIP 4: Don't 'kill -9' the postmaster
    > 
    
    -- 
      Bruce Momjian                        |  http://candle.pha.pa.us
      pgman@candle.pha.pa.us               |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026