LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-29-2006, 03:20 PM   #1
riotxix
LQ Newbie
 
Registered: Jul 2005
Location: England
Distribution: slackware (2.6.10)
Posts: 19

Rep: Reputation: 0
TCL executing commands


Hi, I'm new to TCL - I wrote the bulk of the script in 5 minutes, and have spent over an hour searching for the answer to something simple - I'm quite frustrated now.

Ok...
----
#!/usr/bin/wish -f

button .b -text "Monitor off in 20s" -command {exit}
pack.b
-----


BUT, all I want to do is run the commands
sleep 20s
xset dpms off
exit

while the window is displayed..

so the script exits after 20s switching the monitor off with it. I just can't find a solution on how to do this WHILE the window box . is present - please help.

I tried listing the commands afterwards - it just closes the window and then runs the commands in the console box.
 
Old 12-30-2006, 12:10 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
after 20000 { set dpms off; exit }
man after

PS not tested

Last edited by Wim Sturkenboom; 12-30-2006 at 12:13 AM.
 
  


Reply

Tags
call, exec, fork, system, tcl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
executing shell commands in c++ true_atlantis Programming 2 10-01-2004 04:53 PM
Executing commands and getting command results. xconspirisist Programming 2 03-11-2004 02:52 PM
Executing commands in Konsole... meteotrade Linux - General 5 10-20-2003 06:34 PM
Executing commands with child process benjaminrtz Programming 5 12-18-2002 03:42 PM
Executing commands on startup viciousfish Linux - General 5 06-28-2002 02:15 PM


All times are GMT -5. The time now is 08:18 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration