I have a username
and password
variables. I want to encode them to base64 with the format of username:password
.
#!/bin/bash
username=username
password=password
echo Encoding username/password...
echo $username:$password | base64
That works, but I'm not sure how to put the output in a variable instead of writing it to the console.
On a side note, why is the output different than a website like https://www.base64encode.org/?