Artificial intelligent assistant

Octet binary format in shell script i cut the ip add ect: 10.0.0.0/4 into octet then when i change the octet to binary, it only appear like 1010 not 00001010, how can i make the output with octet format like 00001010. I already try #!/bin/bash y=00000000 o="$(echo "obase=2; 10" | bc)" echo "ibase=2;obase=2; $y+$o" | bc -l But the output still 1010

You could zero-pad your output with `printf`:


$ printf '%08d\
' $(echo "obase=2; 10" | bc)
00001010

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy de6835b5ce91fa18005f7602168d0eb2