Once i execute | xxd -bi
, I get the output as
00000000: 01101000 01100101 01101100 01101100 01101111 00001010 hello.
Now I am trying to remove initial 0000000, which I did using sed and I am trying to remove "hello" (variable text) which is stored in $covertthis
using sed but I can't achieve so, as shown below in the example please suggest me the changes.
I have tried using cut aswell but can't alter both 0000000 and last variable word.
echo "What you want to input numbers or string?"
read input
if [[ "$input" == "number" ]] || [[ "$input" == "Number" ]] || [[ "$input" == "NUMBER" ]] ;then
echo "Number selected 1"
elif [[ "$input" == "String" ]] | [[ "$input" == "STRING" ]] || [[ "$input" == "string" ]] ;then
echo "String selected"
echo "Please give me the string to be XOR'ed"
read convertthis
echo $convertthis | xxd -bi > bin-store
$(sed -i -e 's/00000000://g' bin-store)
$(sed -i -e 's/($convertthis).//g' bin-store)
else
echo "Please re-run the script, input is wrong"
fi