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.

| improve this question | | | | |
  • What shell are you using? Are you actually using the set command? That only works in some shells. – Paused until further notice. 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 exporting. – user1686 Jun 21 '10 at 16:28
2

Try:

export DISPLAY=""

Usually you should have it set like this:

export DISPLAY=":0.0"

or

export DISPLAY="localhost:0.0"
| improve this answer | | | | |
  • 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). – Paused until further notice. 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
4

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.

| improve this answer | | | | |
  • 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
1
export DISPLAY=""

in bash should clear any value

| improve this answer | | | | |
  • No, that's incorrect. – Paused until further notice. 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.