poolpog / bash-otp

One-time Password generator for CLI using bash, oathtool
MIT License
135 stars 24 forks source link

echo -n is not working for me on macOS 10.13.6 #5

Closed osopolar closed 2 years ago

osopolar commented 5 years ago

echo -n and echo -ne is not working for me on macOS 10.13.6, the output looks like -n 12: 345678 and in the pasteboard I get -ne 12: 345678.

I guess it's because

echo is not portable as you experienced. I would suggest to use the POSIX alternative printf see https://apple.stackexchange.com/a/173873/72643

osopolar commented 5 years ago

What about using printf instead of echo? I haven't tested it on Linux, but on macOS 10.13.6 it works.