Date: Tue, 15 Apr 1997 19:44:29 -0700 (PDT) From: Scott Overholser <scotto@remuda.com> To: Zahemszky Gabor <zgabor@CoDe.hu>, freebsd-bugs@freebsd.org Cc: hylafax@freebsd.org Subject: Re: HylaFAX broken on 2.2.0-R? Message-ID: <Pine.NEB.3.93.970415191214.196A-100000@popeye.remuda.com> In-Reply-To: <199704111127.NAA00909@CoDe.hu>
next in thread | previous in thread | raw e-mail | index | archive | help
thanks for the info! here are my results on a 2.2.0-R system: $ f ; echo $? 78 $ g ; echo $? 0 <-- this one is not correct as you describe $ h ; echo $? 78 $ exit if this truely be a bug, what should happen next? as i mention below, i've worked around the problem. i suppose someone should take steps to make it right. i'll gladly file a bug if someone will clue me in on the correct procedure. thanks, -scotto On Fri, 11 Apr 1997, Zahemszky Gabor wrote: > > just figured this out. runMake and some other functions "return" > > explicitly. apparently return returns it's own exit status. after > > removing the return statements from captureX(), capture(), runMake(), and > > runMakeX(), the configure script ran perfectly - and the code built too. > > > > my only question now is why didn't /bin/sh behave similarly in 2.1.x? > > Sorry, I haven't got time to read my mails. So you've found the answer, but > if it is true, it's a bug in /bin/sh. The ``return'' command has to return > the status of the previous command, if return hasn't got a parameter. So > try it: > $ sh > $ f() > return 78 > $ g() > { > f > return > } > $ h() > { > f > } > $ f ; echo $? > 78 # this is the correct answer > $ g ; echo $? > 78 # this is the correct answer > $ h ; echo $? > 78 # this is the correct answer > $ exit > > If you got anything other than three 78's, send the bug report to > freebsd-bugs(?). > > Bye, Gabor > > --- > #!/bin/ksh > trap 'rm -f /tmp/$$.$$' EXIT HUP INT QUIT TERM&&print '21N16I25C25E30, 40M30E33E25T15U!'>/tmp/$$.$$&&IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ '&&set -A X $(</tmp/$$.$$)&&IFS=' 0123456789 '&&set -A Y $(</tmp/$$.$$);IFS=' '&&set -- "${X[@]}"&&for i do [[ $i = ? ] ]&&print $i&&continue;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i&&print -n ${i#???}&&[[ "$j" = ??? ]]&&print -n "${j#??} "&&unset j;typeset +i i;done;set -- "${Y[@]}"&&set -A X&&for i do [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;set -A X "${X[ @]}" $i&&typeset +l i;done&&set -- ${X[@]}&&print $* >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.93.970415191214.196A-100000>