I have a file with content:
EnableSchemaValidation="False" EnableRedshiftImport="True" how do I run a bash/shell command to parse this file and set environment variables as:
√ ~ % echo ${EnableSchemaValidation} False √ ~ % echo ${EnableRedshiftImport} True √ ~ %
source myEnvFile? You can do this on the cmd-line OR include it in a script just before you need your envVars, OR more commonly at/near the top of your script. With a script you may need to make the location/path of the file an envVar (as well) OR just hard-code it , i.e.source /path/to/myEnvFile. Good luck.envVar=$(< /path/to/file_With_value_only_Contents). In your case where/path/to/file...has just the valueFalse, you would doEnableRedshiftImport=$(< /path/to/file...). Good luck.sourceor equivalent requires that it be true universally, and risks security problems otherwise).exportand then source the file.