cc: james.d.carlson at sun.com
Subject: Re: Re: [networking-discuss] Re: [ksh93-integration-discuss] [Fwd: CR
6551714 Created P1/lib/svc/method/net-routing-setup doesn't get along
withksh93=/sbin/sh]
--------
> James Carlson writes:
> > Looking at the code, it seems pretty clear that the author expects
> > that 'set' doesn't change the return code value, and that the "-ne 0"
> > is checking for failures out of /usr/sbin/route itself.
>
> Ah, shoot, I'm a bonehead. Of course it works fine. This is just a
> ksh93 bug and/or misfeature.
>
> In /sbin/sh:
>
> $ set -- `/bin/false`
> $ echo $?
> 255
> $ set -- `/bin/true`
> $ echo $?
> 0
> $
>
> In ksh88:
>
> $ set -- `/bin/false`
> $ echo $?
> 255
> $ set -- `/bin/true`
> $ echo $?
> 0
> $
>
> In ksh93, it appears that this third case actually returns the
> argument count rather than 0 for success.
I have never heard of this.
>
> --
> James Carlson, Solaris Networking <james.d.carlson at sun.com>
> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
> MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
The return value for
set -- ...
will always be 0 for ksh93. If you can demonstrate otherise, please
send me a test base.
A command substitution as a command argument does not affect the
return value. It will affect the exit status of an assignment.
David Korn
dgk at research.att.com