I have a set of piped commands that generates an integer expression. A sample looks like (1 +(0x1f+0x02))
I can evaluate this expression (get the resulting value), by enclosing it in $(), so:
$ echo $((1 +(0x1f+0x02)))
34
I'm interested in getting this to work in a single command, so I tried enclosing my entire series of piped commands within $(), but it seems like bash wasn't able to evaluate the expression. This snippet probably replicates the problem I am seeing:
$ TEST="(1 +(0x1f+0x02))"
$ echo "$TEST"
(1 +(0x1f+0x02))
$ echo $($TEST)
bash: (1: command not found
Not sure what I'm missing here