LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-16-2010, 08:55 PM   #1
madhugp
LQ Newbie
 
Registered: May 2006
Posts: 20

Rep: Reputation: 0
problem in setting DISPLAY variable -redhat linux


hi,

i am using redhat linux 5 .
How to set DISPLAY variable.
setenv command is not working. It is saying command
not found. plz give syntax with example.
also how to find ipaddress of my computer?

thanks
 
Old 02-16-2010, 08:59 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Try this:
Code:
shell$ DISPLAY=:0
shell$ export DISPLAY
And, for the IP address:
Code:
shell$ ifconfig
Sasha
 
Old 02-16-2010, 09:00 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by madhugp View Post
hi,

i am using redhat linux 5 .
How to set DISPLAY variable.
setenv command is not working. It is saying command
not found. plz give syntax with example.
also how to find ipaddress of my computer?

thanks
Spell out your words.

And Google could have answered this easily. Type in "export DISPLAY=<ip address>:0"

To find out the IP address, type in "ifconfig -a".
 
Old 02-16-2010, 09:29 PM   #4
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
An other way of doing it would be directly in front of the command. In some way, it is a little safer
Code:
DISPLAY=:0 firefox
*Or with an IP

But the real secure way to do it is in a SSH tunel to the XServer directly

Code:
ssh -X user@client_host "my_command"
from the X server

Last edited by Elv13; 02-16-2010 at 09:30 PM.
 
Old 02-16-2010, 09:36 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Just for completeness, "setenv" is for csh based shells. You are probably using the bash shell which is from the bourne shell family. Example:

csh
Code:
setenv FOO bar
bourne shell
Code:
export FOO=bar
Cheers,

Evo2.
 
1 members found this post helpful.
Old 02-17-2010, 01:11 PM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Thanks Evo2 -- I had wondered from time to time, where `setenv` could come into play, as I had discovered that it didn't work for me in any of my shells.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in setting DISPLAY variable - madhugp Linux - Software 2 02-16-2010 09:34 PM
Setting the DISPLAY variable in linux wmasry Linux - Newbie 1 12-24-2009 09:04 AM
setting environment variable DISPLAY jpan Debian 4 10-15-2004 06:09 PM
Setting DISPLAY Variable for software texmansru47 Slackware 1 08-02-2004 11:23 AM
About setting DISPLAY variable Rex_chaos Linux - General 4 09-29-2003 01:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration