[colug-432] Exit Status of First Program in Bourne Shell Pipeline

Rick Hornsby richardjhornsby at gmail.com
Fri Dec 4 13:27:38 EST 2015


> On Dec 4, 2015, at 11:59, William Yang <wyang at gcfn.net> wrote:
> 
> Am I missing something in your requirements?
> 
> 	#! /bin/sh
> 
> 	OUTPUT="`$@`"
> 	ERRLEVEL=$?
> 
> 	test "${OUTPUT}" != "" && echo 1 || echo 0
> 	test "${ERRLEVEL}" != 0 && echo 1 || echo 0

+1.  I think that’s a more concise way of what I was going for, but is along the same thought process/interpretation as to the requirements.





More information about the colug-432 mailing list