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 09-16-2010, 07:51 PM   #1
ralfbutler
Member
 
Registered: Jul 2009
Posts: 38

Rep: Reputation: 18
Bash script to find available display sever


Hi there,

Whenever I login to a server via ssh -X, I want that all 5 minutes a script displays a graph.
The script shows the image via display (imagemagick). But what I'm not sure of is how to redirect the display output to my remote screen when this script is executed as a cron job. I can use display -display server but I don't know how to determine server via the script.

Thanks,
Ralf
 
Old 09-18-2010, 05:15 AM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

If the server you're SSHing from is running the display, then you could have the script use the "who" command.

Sample Output of "who"
Code:
sysop@server(SunOS)$ who
sysop   pts/2     Sep 17 12:39 (desktop.example.com)
sysop   dtremote  Sep 17 22:07 (desktop.example.com:0)
sysop   dtremote  Sep 17 05:49 (desktop.example.com:0)
 
  


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
bash script to find/change nicolaus2 Programming 6 02-26-2010 09:50 AM
Another X sever on a second display squirrel-the-tire Linux - Desktop 3 10-02-2009 01:39 PM
find a string within another with bash script jasper25 Linux - Newbie 3 02-01-2009 08:08 AM
How to display remainder in Bash script packets Linux - Newbie 6 12-01-2007 01:30 AM
xset is unable to open display from within bash script copolii Linux - General 3 10-22-2005 06:26 PM

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

All times are GMT -5. The time now is 06:29 AM.

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