Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 1997 13:27:23 +0200 (MET DST)
From:      Zahemszky Gabor <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org (FreeBSD questions)
Cc:        scotto@remuda.com
Subject:   Re: HylaFAX broken on 2.2.0-R?
Message-ID:  <199704111127.NAA00909@CoDe.hu>
In-Reply-To: <Pine.NEB.3.93.970404233722.207A-100000@popeye.remuda.com> from Scott Overholser at "Apr 4, 97 11:40:41 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 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?199704111127.NAA00909>