Hot answers tagged

1

I've figured out why cat | base64 doesn't work as I intended. base64 needs to take in all of the input, terminated by (I think) an EOF. Since output from cat doesn't have the terminator, base64 never stopped taking in and buffering the input, and ctrl-C terminates both cat and base64. Basically, base64 is waiting for the output from cat to end with EOF but ...


1

Something like this? # this is an infinite loop, but can be changed to whatever you need while true; do read x; echo "$x" | base64; done Output: foo Zm9vCg== bar YmFyCg==


Only top voted, non community-wiki answers of a minimum length are eligible