I am trying to use the base64 encoding of an image as a flag when I run my program. Im getting back: Argument list too long
I am on a Ubuntu 16.04 Docker image on a mac.
$ ./myProgram -input "/9j/4AAQSkZJRgABA [...]"
I am trying to use the base64 encoding of an image as a flag when I run my program. Im getting back: Argument list too long
I am on a Ubuntu 16.04 Docker image on a mac.
$ ./myProgram -input "/9j/4AAQSkZJRgABA [...]"
There is a length limit of a single command. This is your program... It should be easier in every way to send the name of the file as the argument to your program which would then read the desired information from the file. You could cat the contents of the file into a variable (if you really want it as a variable). It may be more conventional if you passed the contents of the file to your program via the standard input stream.
Instead of accepting it as an argument, I would suggest you read it from standard in instead.
$ base64 someImage.jpg | ./myProgram
If this program is a shell script, you can save standard in into a variable with something like this:
#!/bin/sh
MY_BASE64_IMAGE_INPUT=$(cat -)
# do something with that info
echo $MY_BASE64_IMAGE_INPUT