Created
January 14, 2014 10:32
-
-
Save synackme/8416343 to your computer and use it in GitHub Desktop.
This is a quick tip if you use an xserver that is running remotly and you want to set the DISPLAY enviroment variable when you login to the machine using ssh. It is actually very simple to do. When you use ssh it will automatically set the SSH_CLIENT enviroment variable to contain the client connection details eg the ip address port number etc..…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ ! $DISPLAY ] ; then | |
if [ "$SSH_CLIENT" ] ; then | |
export DISPLAY=`echo $SSH_CLIENT|cut -f1 -d\ `:0.0 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment