I didn't explain myself very well. I'm not trying to pass $status to the calling shell. I'm reading the output from the echo in a.sh within b.sh. Very similar to cfajohnson POSIX shell method.
#!/bin/sh
# This is a.sh
echo "100"
#!/bin/sh
# This is b.sh
/home/a.sh | read status
echo "This came from b.sh: ${status}"
/home/a.sh
This came from b.sh: 100
I've tried both our scripts in HP-UX 11.11 /bin/sh (a hard link to /usr/bin/sh) and both scripts work. Please try my construct in your shell and let me know if there is an issue.
Neither script works in Bourne shell (mine misbehaves, yours gives syntax errors). We both have omitted to check what the o/p is using.