Running into an issue that is likely simple for people that know how. I am writing an .sh script that reads in a file that has variable names in it. I am trying to use the file following this with the values of the variables in place for the names in the file.
My Attempted .sh Script:
HELLOVAR = "hello"
cat infilename.json > outfilename.json
I then attempt to use outfilename.json, but it has not changed from the original infile.
File In Example:
I would like this to be ${HELLOVAR}.
File Out Wanted:
I would like this to be hello.
HELLOVAR: command not found. If not, show us your actual code.HELLOVAR='hello "cruel" world'(which, to be included in a JSON string, would need to be changed tohello \"cruel\" world), or is your data pre-escaped to be JSON-safe? (If it's the former, you should usejqinstead ofenvsubst; it's perfectly capable of looking up environment variables).