LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Locate environment variables (https://www.linuxquestions.org/questions/linux-newbie-8/locate-environment-variables-670473/)

lusiads 09-17-2008 05:40 AM

Locate environment variables
 
I want to remove a line that set a variable, its name is XMODIFIERS, but I can't locate where is it from.
I see it though:
Code:

$ export|grep -i xmod
declare -x XMODIFIERS="@im=unikey"

But it's not in bash startup files:
Code:

$cat /etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc | grep -i xmod
returns nothing

How can i locate the file which sets declare -x XMODIFIERS="@im=unikey"
Any help would be appreciate.

indeliblestamp 09-17-2008 06:54 AM

I can't think of a file you've missed. As a workaround, you could always unset the variable at the bottom of your ~/.bashrc.
Code:

unset XMODIFIERS

lusiads 09-17-2008 11:41 AM

It's not an optimal idea because XMODIFIERS is set once before XMODIFIERS="@im=unikey" is set and I need the previous value though I don't know what value is it? :)

john test 09-17-2008 12:11 PM

could you cd / and grep XMODIFIERS * to find which file sets XMODIFIER first and what the first setting is?
or use the above to find which files set XMODIFIER nd the comment out the line that sets XMODIFIER and reboot.
Then you could echo $XMODIFIER to see what the initial value of xmodifier is?

david1941 09-17-2008 12:21 PM

If you could find someone with a pristine system the same as yours, that someone might be able to determine what that system is set to. I have Fedora 7 and 9 running and they have XMODIFIERS unset. But your profile is missing.

Dave

lusiads 09-17-2008 05:40 PM

Quote:

Originally Posted by john test (Post 3283342)
could you cd / and grep XMODIFIERS * to find which file sets XMODIFIER first and what the first setting is?
or use the above to find which files set XMODIFIER nd the comment out the line that sets XMODIFIER and reboot.
Then you could echo $XMODIFIER to see what the initial value of xmodifier is?

The exact command was
Code:

grep -r XMODIFIER /etc/*
because 99% config files are located inside /etc/, right?
At first I thought grep through whole huge file system was not practical till i figured out where it must be.

I finally found it inside /etc/X11/Xsession.d
Thank you, I greatly appreciate all your helps.

john test 09-17-2008 05:44 PM

You're very welcome. Glad you found what you were looking for.


All times are GMT -5. The time now is 12:59 AM.