I have a shell script in which I decode an included base64 encoded string, see code below. This works fine on Linux and MacOS for encoded string sizes up to 100s MB in size. However, when using Git Bash on Windows it only works for small size encoded strings. I do not know the exact 'cutoff point' but when using larger strings it does not work anymore and the process hangs forever, with high CPU rate.
Does anybody have experience with this, or maybe a workaround? Preference is to have the encoded string included in the shell script.
Regards,
Emil
#!/bin/bash
openssl base64 -d <<MYSTOPPER > test.txt
VGhlIHBsb3QgcmV2b2x2ZXMgYXJvdW5kIHRoZSBhZHZlbnR1cmVzIG9mIGEgbm9i
bGUgKGhpZGFsZ28pIGZyb20gTGEgTWFuY2hhIG5hbWVkIEFsb25zbyBRdWl4YW5v
LCB3aG8gcmVhZHMgc28gbWFueSBjaGl2YWxyaWMgcm9tYW5jZXMgdGhhdCBoZSBs
b3NlcyBoaXMgbWluZCBhbmQgZGVjaWRlcyB0byBiZWNvbWUgYSBrbmlnaHQtZXJy
YW50IChjYWJhbGxlcm8gYW5kYW50ZSkgdG8gcmV2aXZlIGNoaXZhbHJ5IGFuZCBz
ZXJ2ZSBoaXMgbmF0aW9uLCB1bmRlciB0aGUgbmFtZSBEb24gUXVpeG90ZSBkZSBs
YSBNYW5jaGEu
MYSTOPPER
# This is the output string:
# 'The plot revolves around the adventures of a noble (hidalgo) from La Mancha named Alonso Quixano, who reads so many chivalric romances that he loses his mind and decides to become a knight-errant (caballero andante) to revive chivalry and serve his nation, under the name Don Quixote de la Mancha.'
# Works fine on MacOS and Linux for any size encoded string, fails in Git Bash on Windows with larger strings