> Peter Memishian wrote:
> >  > > * Using -p" for starting non-interactive shell
> scipts is AFAIK a NO-OP,
> >  > > e.g.
> >  > > -- snip --
> >  > > #!/bin/ksh -p
> >  > > -- snip --
> >  > > should be replaced with
> >  > > -- snip --
> >  > > #!/bin/ksh
> >  > > -- snip --
> >  >
> >  > I've recently been burned by this one.  lucreate
> or luupgrade (I
> >  > forget which) blew up due to missing -p and
> having some questionable
> >  > stuff in the file pointed to by $ENV.
> > 
> > Indeed.  I think the rule should be exactly the
> opposite of Roland's
> > advice: "-p" should be mandatory in all shell
> scripts.  (We've been burned
> > by this internally many, many times.)
> 
> Uhm... if you're right the following should print
> "chicken terror":
> -- snip --
> $ (echo 'print "chicken"' >msg1 ; echo 'print
> "terror"' >msg2)
> $ (ENV=$PWD/msg1
> LD_LIBRARY_PATH=$ROOT/usr/lib/64:$ROOT/usr/lib
> $ROOT/usr/bin/ksh93 $PWD/msg2) 
> terror
> $ (ENV=$PWD/msg1
> LD_LIBRARY_PATH=$ROOT/usr/lib/64:$ROOT/usr/lib ksh
> $PWD/msg2) 
> terror
> -- snip --
> ... but I am only getting the output of the 2nd
> script here... am I
> doing something wrong ?

On Solaris 8, old /bin/ksh prints both, but  even dtksh (very early and buggy
ksh93-based) only prints the 2nd one.  On Solaris 10, /bin/ksh only prints
the 2nd.  I suppose somewhere it was decided that that sourcing $ENV
for a non-interactive ksh was incorrect, but I'm not going to spend any
more time trying to figure out just when that changed...
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to