Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 12-29-2006, 03:20 PM   #1
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.

#!/usr/bin/wish -f

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

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

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
after 20000 { set dpms off; exit }
man after

PS not tested

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


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 > Forums > Non-*NIX Forums > Programming

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

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