I am trying to invert an 8 bit Binary number using bash and shell script making 1 0 and vice versa then save the new variable, turning 10101010 into 01010101.
input=10101010
echo $input
echo $Input | tr 01 10
will give me
10101010
01010101
but does not allow me to save this to a new variable if i try:
invertedInput=$Input | tr 01 10
How can I get this right?