I'm looking for a way to manipulate some env var, which will be available for processes spawned by bash.Something like the below (of course, the syntax is not correct)/bin/bash VAR_X=2and then later command being run from bash script can do if [ $ENV_VAR_X = 2 ] .. Notice that I'm invoking bash from a windows Console2/Msys setup, so doing VAR_X=2 bash is not an option.Does anyone know how it can be done?
Bash - setting environment vars from bash invocation line
bash;environment variables
Tryenv VAR_X=2 commandThis would pre-define the variable named VAR_X (only if you runs bash as current shell)EDITTo fix that on Windows system, simply create a cmd script, that set the variable prior to execution, or in My Computers->Advanced->Environment Variables set a global one,@echo offset VAR_X=2command