Roland Roeder <roland_roeder@cocreate.com> wrote:
> set -- `echo $foo; exit 1`
>
> doesn't return the exit code 1. I don't know, whether this is
> defined in any standard.
It isn't, AFAICT. The set command itself succeeded, so its exit
status is 0. But this works for me (tested with /bin/sh on Linux,
FreeBSD, NetBSD, OpenBSD, and Solaris):
x=`echo $foo; exit 1`
The exit status of this command is 1. Then you can do "set -- $x".
paul