Visit Our UNIX and Linux User Community


xterm trivia


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers xterm trivia
# 1  
Old 07-25-2001
xterm trivia

Thanks Livin Free...


Here's another one... Why is it that I always get the error message "Error: Can't open display:" in my mail whenever I execute or try to call an xterm command using cron to activate the command. What did I miss? Thanks in advance UNIX gurus...
# 2  
Old 07-25-2001
This indicates that cron does not have permission to access your X display. Maybe if you set the DISPLAY variable explicitly from cron? I'm not sure why you would need to run an X term from cron anyway...X apps are inherently interactive, they are not really designed to be run non-interactively from cron.
# 3  
Old 07-25-2001
Quote:
Originally posted by PxT
This indicates that cron does not have permission to access your X display. Maybe if you set the DISPLAY variable explicitly from cron? I'm not sure why you would need to run an X term from cron anyway...X apps are inherently interactive, they are not really designed to be run non-interactively from cron.
Would you suggest that we customize an X-application for this purpose? Are there other options? Thanks for your reply.
# 4  
Old 07-25-2001
I think PxT is correct in saying that the DISPLAY variable is not set. You can set the $DISPLAY in cron, or in your srcipt / application.

If you just want some quick, simple notification, you could pop up an xterm on, say, $DISPLAY=":0", with a few lines of code:
Code:
#!/bin/sh
DISPLAY=":0"
Pay_Attention () {
echo "It is time for you to pay attention!"
echo "Press {Enter} when you are done..."
read _dummy_response
  case $_dummy_response in
     *) exit 0 ;;
   esac
}

xterm -e Pay_Attention
exit

I'm sure there's a better way of doing that, but thats the first one that popped into my head... Heck, that as-is probably won't work, but it given you an idea of what I'm thinking, right? Smilie
Either way - the xterm will close when someone presses the enter key...

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 11:26 AM..
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #424
Difficulty: Medium
C# was designed by Anders Hejlsberg.
True or False?

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

Computer Trivia Feature Tops 50,000 Questions Answered

Just noticed that our successful computer trivia feature (stats here) has surpassed over 50,000 questions answered by users: https://www.unix.com/trivia_stats.php This was a coding effort worth while and I'm pleased to see so many people enjoying it in such a short time since it was released... (3 Replies)
Discussion started by: Neo
3 Replies

2. What is on Your Mind?

Debugging Our Computer Science Trivia Feature

Only a few days after I coded this new feature from scratch, we are seeing over 3000 entries in the database from members (mostly guests) playing CS trivia. I have spend a lot of time coding this (from scratch) and testing the API. From the logs, it seems to have an API bug which appears... (31 Replies)
Discussion started by: Neo
31 Replies

3. What is on Your Mind?

New Member and Country Computer Trivia Leaderboards

Thanks to Akshay, who helped me write the core MySQL queries, we now have two new draft leaderboards, by (1) member and by (2) country: https://www.unix.com/trivia_stats.php Currently milhan leads the members with a high score of 90%: ... (3 Replies)
Discussion started by: Neo
3 Replies

4. What is on Your Mind?

1000+ Computer Science Trivia Questions at UNIX.COM

The UNIX and Linux Forums now has over 1000 TRUE / FALSE computer science and computer related trivia question in our database. These questions are of relatively high quality (compared to similar sites on the web) and are fun (according to feedback by users). In the first week during the... (1 Reply)
Discussion started by: Neo
1 Replies

5. What is on Your Mind?

Forum Trivial Pursuit - New Computer Science and Mathematics Trivia for UNIX.com

I have added a new experimental "Computer Science and Mathematics Trivia - True or False" section in the discussions, currently under the tags box. In the future, I plan to Expand this feature to add more trivia categories from math, science and technology. Keep track of correct and... (20 Replies)
Discussion started by: Neo
20 Replies

Featured Tech Videos