Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it should be base64 -D instead of base64 -d #2

Open
ivanmarchenko83 opened this issue Feb 8, 2019 · 1 comment
Open

it should be base64 -D instead of base64 -d #2

ivanmarchenko83 opened this issue Feb 8, 2019 · 1 comment

Comments

@ivanmarchenko83
Copy link

ivanmarchenko83 commented Feb 8, 2019

it should be base64 -D instead of base64 -d
so

TOKEN=`aws ecr --region=$REGION get-authorization-token --output text --query authorizationData[].authorizationToken | base64 -D | cut -d: -f2`
@whereisaaron
Copy link
Owner

Hi @ivanmarchenko83, I think might be using a system with a different implementation of base64. GNU Linux base64 had no option -D and -d or --decode are the correct options. What base64 are you using? Would using --decode work for both regular GNU Linux and your version?

$ base64 -D
base64: invalid option -- 'D'

https://www.gnu.org/software/coreutils/manual/html_node/base64-invocation.html

base64 transforms data read from a file, or standard input, into (or from) base64 encoded form. The base64 encoded form uses printable ASCII characters to represent binary data. Synopses:

base64 [option]… [file]
base64 --decode [option]… [file]
The base64 encoding expands data to roughly 133% of the original. The base32 encoding expands data to roughly 160% of the original. The format conforms to RFC 4648.

The program accepts the following options. Also see Common options.

‘-w cols’
‘--wrap=cols’
During encoding, wrap lines after cols characters. This must be a positive number.

The default is to wrap after 76 characters. Use the value 0 to disable line wrapping altogether.

‘-d’
‘--decode’
Change the mode of operation, from the default of encoding data, to decoding data. Input is expected to be base64 encoded data, and the output will be the original data.

‘-i’
‘--ignore-garbage’
When decoding, newlines are always accepted. During decoding, ignore unrecognized bytes, to permit distorted data to be decoded.

An exit status of zero indicates success, and a nonzero value indicates failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants