I have the following code...it is mostly working. Except I am wanting to write the result of sed into the variable newData. Have viewed many other posts, and none have managed to work for me.
newin="<font color='default'>Default Color has been choosen.</font>"
newData="$newin" | sed 's/</</g; s/>/>/g; s/<[^>]*>//g'
if [[ ${newin:0:1} == "<" ]]
then
#this echo works like it should
echo "$newin" | sed 's/</</g; s/>/>/g; s/<[^>]*>//g'
#this echo works like it should
echo "$newin"
#The variable newData does not seem to capture the data
newData=${newin} | sed 's/</</g; s/>/>/g; s/<[^>]*>//g'
echo "[$newdata]"
fi
it outputs:
Default Color has been choosen.
<font color='default'>Default Color has been choosen.</font>
[]