I am trying to prepare url, in which email address will be base64 encoded. However when I encode the email with base64 it returns emptry string, without base64 encode this works fine, what am I missing here?
here is shell script without base64 encode
#!/bin/bash
link='unsubscribe'
testVar="$link/""[email protected]"
echo "www.somedomain.com/$testVar/email/"
Output:
www.somedomain.com/unsubscribe/me@domain/email/
I am trying to encode email with base64 like this:
#!/bin/bash
link='unsubscribe'
testVar="$link/""[email protected]"|base64
echo "www.somedomain.com/$testVar/email/"
Output
www.somedomain.com/unsubscribe//email/
Notice the email did not get encoded, returned empty value
what I am missing here?