I have a problem with a variable that I want to keep, but I suppose that by the memory reference that Bash does, he crushes me anyway.
I have a function that I call with 3 parameters:
MiFuncion "Correo sin leer" "[email protected]" "Este es el Asunto"
(this last parameter can be an encoded string, like this: "=? utf-8? B? dfICfer43p42rf324orF?=")
function MiFuncion() {
ASUNTO="$3"
echo "$3" | grep -q '\=\?utf-8\?B'
if [ $? -ne 0 ]; then
vSubject2='grep -oP '(?<=B\?).*?(?=\?)' <<< "$3"'
ASUNTO='echo "$vSubject2" | base64 --decode'
fi
echo $2
echo $ASUNTO
}
But $ SUBJECT comes out empty when it is not coded, that is, the IF is not fulfilled. Any suggestions?
Thank you, best regards