I am having weird output on base64 operations. I have something I want to programmatically download, and found that the links contains base64 encoded data ({date}.zip
. This is evidenced by the following:
> echo "MjAyMS0wMS0xMy56aXA=" | base64 --decode
2021-01-13.zip%
If I pipe that back into base64
, I get the same result back:
> echo "MjAyMS0wMS0xMy56aXA=" | base64 --decode | base64
MjAyMS0wMS0xMy56aXA=
However, if I pass the decoded string directly to base64, I get a different result:
> echo "2021-01-13.zip" | base64
MjAyMS0wMS0xMy56aXAK
Curious as to why this is happening, and how I can resolve.
Thanks!
%
really there?zsh
. It informs you this way there is no newline character at the end of the output. Other shells would not care, they would straightforwardly print their prompt. In effect the prompt would be in the same line, concatenated with2021-01-13.zip
.zsh
instead ofbash
, shouldn't it?