xor 2 values in ksh?

i have to xor two variables in ksh. how to do that?

tia,
DN2

It's easier done with Perl:

perl -le 'print (16 ^ 5)'
21

perl -le 'print (21 ^ 5)'
16

perl is no option.... its not on all systems :frowning:

A possible solution:

a=15
b=10
a_xor_b=$(perl -e "print $a^$b")     <- gives 5

Jean-Pierre.

Sorry, my bad. This can be done with KSH using built in operations (I haven't really had a need for this to date).

print $(( 16 ^ 5 ))
21

print $(( 21 ^ 5 ))
16

this works... thank you so much!