I like to encode with base64 from stdin by invoking the command pasting the input and pressing Ctrl + D twice in order to avoid a trailing newline if I don't want one to be part of the input. It avoids echo and leaves no data in the shell history.
However, the output is written directly after the input and it's hard to retrieve the value:
$ base64
Input without trailing newlineSW5wdXQgd2l0aG91dCB0cmFpbGluZyBuZXdsaW5l
Is there any way I can look like
$ base64
Input without trailing newline
SW5wdXQgd2l0aG91dCB0cmFpbGluZyBuZXdsaW5l
without any newlines being included in the encoded output?
I'm using Ubuntu 23.10.