On Fri, Aug 12, 2022 at 6:51 PM Budi <budikus...@gmail.com> wrote: > It doesn't work means no use on set -x, no value is shown > > On 8/13/22, Dennis Williamson <dennistwilliam...@gmail.com> wrote: > > On Fri, Aug 12, 2022, 6:28 PM Budi <budikus...@gmail.com> wrote: > > > >> How come math/arithmetic ((i=k+l)) cannot make use of set -x > >> > >> Please help.. > >> (so annoying). > >> > > > > > > It works for me. What are you expecting? > > > > It would help if you show what you're doing, the result you're getting > and > > what you expect instead. > > > > "It doesn't work" conveys no information whatsoever. > > > >> > > >
Hmmm... interesting. $ set -x; unset a; b=2; c=7; ((a = $b + $c)); echo "$a $b $c"; set +x + unset a + b=2 + c=7 + (( a = 2 + 7 )) + echo '9 2 7' 9 2 7 + set +x shows the values in the arithmetic expression, but set -x; unset a; b=2; c=7; ((a = b + c)); echo "$a $b $c"; set +x + unset a + b=2 + c=7 + (( a = b + c )) + echo '9 2 7' 9 2 7 + set +x without the dollar signs doesn't. Also, note that this message includes a thorough example of doing, result, expecting. -- Visit serverfault.com to get your system administration questions answered.