I found this in some code that I was working on. It was designed to work on the requirement to read a key file from disk. In production, the contents of the key file were in an environment variable.
Old code:
key = File.read('path/to/key.pem')
New code:
key = File.read('| echo $KEY_VARIABLE')
How it works?
source share