I am creating a kind-of alias for fast base64 encoding of strings. For it I have created following function and added it to my .bash_profile file:
# My functions
function b64() {
perl -MMIME::Base64 -e 'print encode_base64("$1");'
}
The problem is that it encodes the string "$1" itself without processing actual value that I am "giving" to it in request:
$ b64 "test_value"
JDE=
$ echo -n "JDE=" | base64 -d
$1
I have tried using '$1' and "$1", without any quotes, but the problem persists still and it keeps encoding $1 as string and not a value.
Could you please check what am I missing here? Thanks in advance!