Details
-
Documentation
-
Status: Closed
-
Medium
-
Resolution: Done
-
None
-
None
Description
Private data tutorial instructions:
export MARBLE=$(echo -n "{\"name\":\"marble1\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64)
fails on linux with error:
Error: error parsing transient string: invalid character '\n' in string literal - proposal response: <nil>
Reason is because base64 command on linux adds a problematic newline character to wrap after every 76 characters.
To fix this you can use
-w 0
to eliminate the wrapping.
However -w option is not available in Alpine, therefore we will manually remove any existing newline characters, this will work across all platforms:
export MARBLE=$(echo -n "{\"name\":\"marble1\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64 | tr -d \\n)
Thanks to tip at: https://superuser.com/a/1225334