[comp.unix.ultrix] Ultrix 4.0 bourne shell scripting

brister@decwrl.dec.com (James Brister) (08/07/90)

On 7 Aug 90 13:34:28 GMT,
bobd@hpuxa.ircc.ohio-state.edu (Bob Debula) said:

> I am porting stuff from the HP-UX environment and thought that the syntax
> rules for the Bourne shell were more or less universal.  Is this an
> Ultrix peculiarity (and why did they decide not to support the ":" form)
> ?

The Ultrix standard Bourne shell (/bin/sh) is an old version. To get the
":-" behaviour as well as user-definable functions, you want to use the
shell /usr/bin/sh5 (which comes from System V release 2).

James
--
James Brister                                           brister@decwrl.dec.com
DEC Western Software Lab.                                 .....!decwrl!brister

bobd@hpuxa.ircc.ohio-state.edu (Bob Debula) (08/07/90)

I just started working with Ultrix 4.0 a few days ago.  This morning,
I tried to port a couple of Bourne shell scripts over and got:

sh: bad substitution

for the line:  grep ${1:-":"} /etc/passwd


I then tried just "-" in the above construct
in place of ":-" and everything worked fine.  I am porting stuff
from the HP-UX environment and thought that the syntax rules
for the Bourne shell were more or less universal.  Is this an
Ultrix peculiarity (and why did they decide not to support
the ":" form) ? 

==========================================================================
Bob DeBula                    | Internet:   bobd@hpuxa.ircc.ohio-state.edu
The Ohio State University     | Disclaimer: These are my views, not the U's
Davros sez:   When my Daleks compute they use X-TER-MI-NALS!

emv@math.lsa.umich.edu (Edward Vielmetti) (08/08/90)

In article <BRISTER.90Aug7093243@westworld.decwrl.dec.com> brister@decwrl.dec.com (James Brister) writes:

   The Ultrix standard Bourne shell (/bin/sh) is an old version. To get the
   ":-" behaviour as well as user-definable functions, you want to use the
   shell /usr/bin/sh5 (which comes from System V release 2).

Interesting.  Perhaps that explains why the "xon" script I got from
somewhere (last modified by dgreen@cs.ucla.edu) which fires up an
X application on another host dies with "bad substitution" or some
such when I use /bin/sh, but works OK with /usr/bin/sh5.

--Ed

Edward Vielmetti, U of Michigan math dept <emv@math.lsa.umich.edu>

steve@wattres.UUCP (Steve Watt) (08/13/90)

>In article <BRISTER.90Aug7093243@westworld.decwrl.dec.com> brister@decwrl.dec.com (James Brister) writes:
>
>The Ultrix standard Bourne shell (/bin/sh) is an old version. To get the
>":-" behaviour as well as user-definable functions, you want to use the
>shell /usr/bin/sh5 (which comes from System V release 2).

Is there some reason for DEC to continue distributing the old sh?  I thought
that sh5 was a complete superset of it....

s5make and make are at least different enough...  Sorta...
-- 
Steve Watt
...!claris!wattres!steve		wattres!steve@claris.com also works
If you torture your data long enough, it'll eventually confess.

diamond@tkou02.enet.dec.com (diamond@tkovoa) (08/13/90)

In article <593@wattres.UUCP> steve@wattres.UUCP (Steve Watt) writes:
>>In article <BRISTER.90Aug7093243@westworld.decwrl.dec.com> brister@decwrl.dec.com (James Brister) writes:
>>The Ultrix standard Bourne shell (/bin/sh) is an old version. To get the
>>":-" behaviour as well as user-definable functions, you want to use the
>>shell /usr/bin/sh5 (which comes from System V release 2).
>Is there some reason for DEC to continue distributing the old sh?

Because BSD did so.  (But I can't tell you which version of BSD.)

>I thought that sh5 was a complete superset of it....

That's my understanding too.
-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
This is me speaking.  If you want to hear the company speak, you need DECtalk.