Sample Header Ad - 728x90

How to decode base64 for both Linux and macOS?

3 votes
1 answer
3652 views
On Linux I can do:
echo ${ANDROID_KEYSTORE} | base64 -di > android/keystores/staging.keystore
But on macOS, the same commands give:
base64: option requires an argument -- i
Usage:	base64 [-hvDd] [-b num] [-i in_file] [-o out_file]
  -h, --help     display this message
  -Dd, --decode   decodes input
  -b, --break    break encoded string into num character lines
  -i, --input    input file (default: "-" for stdin)
  -o, --output   output file (default: "-" for stdout)
I have tried to replace -di with --decode --input, but it didn't help. 1. How do I fix the macOS command? 2. Is there a command that works both on Linux (Debian/Ubuntu) and macOS?
Asked by Dimitri Kopriwa (143 rep)
Oct 31, 2022, 05:10 PM
Last activity: Nov 1, 2022, 07:30 AM