Your Answer

You are not seeing the environment variables available to an application run, for example, directly by the graphic interface. To see the environment variables available to the application started directly in the graphic environment, you can do the following in Gnome Shell, I am sure there is an equivalent method in all the other DE :.


  1. Don’t like launchd automatically setting up DISPLAY for you??
  2. office mac 2008 entourage download.
  3. reviews of mac laptops 2020.
  4. Environment variable?
  5. Bus Error in IDL 6.3 on Mac OSX?
  6. vector magic free download per mac.

Or, if you do not have xterm , gnome-terminal -- bash --noprofile --norc thanks to Mike Nakis for the comment. You now have a terminal with a shell that did not add any environment variables. You can use env here to list all your environment variables:. Obviously the new shell will have the environment variables added by the system files, but that variables should be available by inheritance to all programs in the system anyway.

I am posting this because it's the fourth time I have to search this trick again, checking my. So now I will find it faster and in the process, I hope helping someone else It only shows exported variables: non-exported variables are not usually considered "environment variables". Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. How to list all variables names and their current values? Ask Question. Asked 6 years, 4 months ago.

Active 1 month ago. Viewed k times. Strapakowsky Strapakowsky 4, 11 11 gold badges 27 27 silver badges 38 38 bronze badges. You've accepted an incorrect answer. If you truly want all variables currently declared in your shell, use "declare -p" or "typeset -p". For bash: the standard shell in Ubuntu Enter the following command in a terminal to print all the environment variables: printenv For further information about this command, read the printenv man page.

X11 server

To show a list including the "shell variables" you can enter the next command: set -o posix ; set less This will show you not only the shell variables, but the environment variables too. For more information related with this topic read: How to list variables declared in script in bash?

For zsh: an advanced shell Use the following command: setopt posixbuiltin; set; less For more information about ZSH options, see zshoptions man page. Fabby Lucio Lucio 13k 25 25 gold badges 88 88 silver badges bronze badges. Why is that, and how do those others show up? Probably you are seeing the difference between a shell variable and an environment variable.

To expand on Rmano's reply to Strapakowsky Using export says "the variable I'm setting should be part of the environment that gets passed to processes, not just a variable in this shell. In all the methods described above, the procedure that is suggested is: launch a terminal show the environment variables using env , or printenv or whatever The problem of these solutions are that you are seeing the environment variables of the shell that is running into the terminal.

Navigation menu

To see the environment variables available to the application started directly in the graphic environment, you can do the following in Gnome Shell, I am sure there is an equivalent method in all the other DE : press Alt-F2 run the command xterm -e bash --noprofile --norc Or, if you do not have xterm , gnome-terminal -- bash --noprofile --norc thanks to Mike Nakis for the comment.

You can use env here to list all your environment variables: Obviously the new shell will have the environment variables added by the system files, but that variables should be available by inheritance to all programs in the system anyway. Rmano Rmano Requires you have a desktop environment, not useful for server CLI-only folk. Nah, I was actually trying to go from a regular terminal -- not the one that spawns from the X11 app.

BASH/sh/ksh

I use the "-X"; it doesn't work. I have to set the display first in order to get it to act right. Ok, so now I'm confused. Already done. I'm lost.. I'm still confuzzled. If you change it on the remote box to point to your Mac, you're not tunneling it over ssh. If the remote machine's ssh daemon is properly set up, using ssh -X will cause the remote machine's DISPLAY variable to be set to a special value that corresponds to a tunnel that ssh has built back through its connection.

Allow me to clarify: Case 1. Start a regular OS X terminal and connect to remote machine with ssh -X. It creates no Xauthority file and I get a display error when running nmapfe.

www.neuron.yale.edu

I then run ssh -X and connect to the same machine. It creates me a new Xauthority file and I am able to run nmapfe. But yeah, there is a possibility that the X session that does work isn't going over SSH, but this still leaves me with the problem of getting it to work over the tunnel. From Linux to Linux or Windows to Linux it works fine so it's just a matter of a setting Also could you post a printout of all environment variables on the remote machine?

Finally, could you add a -v to your ssh and include the verbose info here, from the point where you initiate the connection to the point where your shell on the remote machine is established? By 'connect to the same machine' do you mean 'connect to the same remote machine I connected to in Case 1' or 'connect via loopback to the same machine I am on'?

Environment Variables

Do you see how your wording confuses me? Interesting topic You can see this by starting a fresh X11 and a fresh Terminal. From this point I can go to the xterm and "ssh -X remotesys " then start an X app on the remote system to display on my Mac. If I go to the Terminal. But if I exit the ssh session in Terminal. So the moral of your story is to ssh to the remote machine from a terminal e.

Not exactly. In the end I just found it easier just to use the xterm to do it and not worry about the Terminal.

macos - What should I set the $DISPLAY environmental variable to? - Stack Overflow

Fired up Kate on the ssh tunnel and Ethereal on my Mac at least claims that all the traffic is going over encrypted SSH. Except some ACKs, of course. I don't know about that; it's pretty weird because I had run across it a couple weeks ago after a fresh install when my.