Considering the following excerpt:
On FreeBSD 13.0-RELEASE-p11 I'm getting the following output:
Is this a (known) bug or am I missing something?
Thanks in advance.
Code:
1 #!/bin/sh
2
3 check()
4 {
5 echo $1 - \
6 $(
7 [ $2 -eq $3 ] \
8 && echo OK \
9 || echo FAIL "($2 != $3)"
10 )
11 }
12
13 main()
14 {
15 check 2 $LINENO 3
16
17 inner()
18 {
19 check 4 $LINENO 3
20 }
21
22 check 3 $LINENO 10
23 inner
24 }
25
26 check 1 $LINENO 26
27 main
Rich (BB code):
# ./lineno
1 - OK
2 - OK
3 - FAIL (22 != 10)
4 - OK
Thanks in advance.