Michael Kurt
09/26/2014 2:32 AM
post111884
|
> echo $$(( 4 < 2 ) && ( 5 < 6 ))
For this, You do not really need the inner parentheses, so throw them away try: echo $$(4<2 && 5<6)
HTH,
Michael.
|
|
|
Kevin Schaffer(deleted)
09/26/2014 10:38 AM
post111892
|
Well, the permutations attempting to reverse-engineer a not-intuitive system approaches infinity.
Tried this:
echo "Logic test follows"
echo $(or 1,0)
echo $(or 0,0)
echo "Or 0 1"
echo $(or 0,1)
echo "Or 1 1"
echo $(or 1,1)
echo $(and 0,0)
echo $(and 1,0)
echo $(and 0,1)
echo $(and 1,1)
echo $(xor 0,0)
echo $(xor 0,1)
echo $(xor 1,0)
echo $(xor 1,1)
Get this:
echo "Logic test follows"
Logic test follows
echo 1
1
echo 0
0
echo "Or 0 1"
Or 0 1
echo 0
0
echo "Or 1 1"
Or 1 1
echo 1
1
echo 0
0
echo 0
0
echo 1
1
echo 1
1
echo
echo
echo
echo
Note:
Or 0 1
echo 0
0
echo "Or 1 1"
Or 1 1
echo 1
1
So whatever or does, it isn't or.
xor doesn't do anything other than nullify input apparently.
Tried or without comma:
echo $(or 1 1)
-->
echo 1 1
1 1
These aren't errors, nor are they boolean operations.
|
|
|
Kevin Schaffer(deleted)
09/26/2014 11:53 AM
post111894
|
In lieu of that, trying the daisy-chain route :(
QCCMAJORVER := 6
M3 = $$(( $(QCCMAJORVER) > 2 ))
...
(stuff)
echo "Hello, world!"
echo $(QCCMAJORVER)
echo "$(M3)"
echo $(M3)
ifeq ($(M3),1)
echo "New"
else
echo "Old"
endif
echo "End"
Gives
echo "Hello, world!"
Hello, world!
echo 6
6
echo "$(( 6 > 2 ))"
1
echo $(( 6 > 2 ))
1
echo "Old"
Old
echo "End"
End
Why does 1 not equal 1, causing it to print Old instead of New? Is it comparing something like a string of "$(( 6 > 2
))" to 1 instead of evaluating it? What forces it to evaluate in an ifeq lline?
|
|
|