Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find where an environment variable is set

Say I have some environment variable PROJECT_HOME. I want to find out which file it is set in. How do I do this?

like image 250
well actually Avatar asked Nov 08 '11 23:11

well actually


People also ask

How do I find my environment variable PATH?

Select Start, select Control Panel. double click System, and select the Advanced tab. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it.

How do I check if an environment variable is set?

In the command window that opens, enter echo %VARIABLE%. Replace VARIABLE with the name of the environment variable you set earlier. For example, to check if MARI_CACHE is set, enter echo %MARI_CACHE%. If the variable is set, its value is displayed in the command window.


2 Answers

grep -r PROJECT_HOME /etc $HOME

will probably find it.

like image 196
Andrew Schulman Avatar answered Oct 30 '22 12:10

Andrew Schulman


find $HOME -type f -exec grep -Hn 'PROJECT_HOME' {} \;
like image 39
chemila Avatar answered Oct 30 '22 12:10

chemila