On Tue, 21 Jun 2011, Rich Wales wrote:

printf '\000user\000pass' | openssl base64

This appears to work OK in tcsh and sh on Linux (Ubuntu Maverick).
It also works if I write "\0" instead of "\000".

Careful, that won't do the right thing if either string starts with a valid octal digit. Either use the full '\000', or be even more explicit:

printf '\0%s\0%s' 'user' 'pass' | openssl base64

-Rob

Reply via email to