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.

Nishant
  • 265
  • 3
  • 5
  • 11
  • What shell are you using? Are you actually using the `set` command? That only works in some shells. – Dennis Williamson Jun 21 '10 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 `export`ing. – user1686 Jun 21 '10 at 16:28

3 Answers3

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.

belacqua
  • 583
  • 4
  • 10
Christopher Karel
  • 6,582
  • 1
  • 28
  • 34
  • 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 '10 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 '10 at 14:52
2

Try:

export DISPLAY=""

Usually you should have it set like this:

export DISPLAY=":0.0"

or

export DISPLAY="localhost:0.0"
Weboide
  • 3,345
  • 1
  • 25
  • 33
  • 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). – Dennis Williamson Jun 21 '10 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 '10 at 13:59
1
export DISPLAY=""

in bash should clear any value

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
smcavoy
  • 176
  • 3
  • No, that's incorrect. – Dennis Williamson Jun 21 '10 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 '10 at 13:56