1

I want to clear export DISPLAY=My IP Address that I had given. It has botched up my X settings, so now I just want it to be reset like normal. How to clear this export parameter. Simple set DISPLAY= doesn't work.

Please tell me how to achieve this.

2
  • What shell are you using? Are you actually using the set command? That only works in some shells. Jun 21, 2010 at 13:51
  • The only way to get it "like normal" is to logout and login again. Sure, unset will clear the variable, but it is not necessarily the same as it was before exporting. Jun 21, 2010 at 16:28

3 Answers 3

2

Try:

export DISPLAY=""

Usually you should have it set like this:

export DISPLAY=":0.0"

or

export DISPLAY="localhost:0.0"
2
  • If it's already exported it doesn't need to be again. Also, some shells won't let you do export and an assignment at the same time. You might have to do DISPLAY=""; export DISPLAY (if it hasn't already been exported). Jun 21, 2010 at 13:55
  • Ideally I want it like before I exported anything . My idea output is something like blank if I get set | grep DISPLAY . Which is before I set anything . In this case it shows locahost:0.0 I want VNC to take control of this DISPLAY thing
    – Nishant
    Jun 21, 2010 at 13:59
5

As others have mentioned, knowing the shell you're using might help.

Otherwise, have you tried simply using unset? The exact command would be unset DISPLAY, for this specific variable.

2
  • I have withdrawn my answer for unset since I missed you already answered it :) It certainly seems like that would accomplish what was asked and I know it works in at least BASH, KSH and CSH.
    – Alex
    Jun 21, 2010 at 14:30
  • 1
    I, too, missed it. But this is correct. Suggested edit: "unset DISPLAY", to match the question being asked.
    – mpbloch
    Jun 21, 2010 at 14:52
1
export DISPLAY=""

in bash should clear any value

2
  • No, that's incorrect. Jun 21, 2010 at 13:49
  • Somehow even after the command , I am getting [[root@charlie originalnotbuildable]# export="" [root@charlie originalnotbuildable]# echo $DISPLAY charlie:2 I am trying to open a VNC session and somehow this charlie:2 session is not changing.
    – Nishant
    Jun 21, 2010 at 13:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .