From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11527 invoked by alias); 22 Dec 2004 17:20:11 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 11354 invoked from network); 22 Dec 2004 17:20:02 -0000 Received: from unknown (HELO web53610.mail.yahoo.com) (206.190.37.43) by sourceware.org with SMTP; 22 Dec 2004 17:20:02 -0000 Received: (qmail 76786 invoked by uid 60001); 22 Dec 2004 17:20:02 -0000 Message-ID: <20041222172002.76779.qmail@web53610.mail.yahoo.com> Received: from [209.210.229.214] by web53610.mail.yahoo.com via HTTP; Wed, 22 Dec 2004 09:20:02 PST Date: Wed, 22 Dec 2004 17:20:00 -0000 From: Brad Gutt Subject: expect and tclsh give different output from "clock scan" To: insight@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-q4/txt/msg00150.txt.bz2 Hi, I'm posting this to this group since the cygwin announce email posting for expect stated that expect in cygwin was bundled up by Insight people at Red Hat. Let me know if I should take this elsewhere... The "clock scan " command inside tclsh returns a different number when executed from within tclsh versus expect. This is running on a Windows 2000 laptop running under Cygwin. The time numbers I am expecting are for my local time since I am not specifying a timezone. Check out this transcript: $ tclsh set dailyTime 5pm puts [clock scan "today $dailyTime"] 1103763600 exit $ expect set dailyTime 5pm puts [clock scan "today $dailyTime"] 1103767200 exit $ expect -v expect version 5.26 $ tclsh puts "tcl_version $tcl_version" tcl_version 8.4 puts [info patchlevel] 8.4.1 exit $ expect -d expect version 5.26 argv[0] = /bin/expect argv[1] = -d set argc 0 set argv0 "/bin/expect" set argv "" executing commands from command file puts "tcl_version $tcl_version" tcl_version 8.4 puts [info patchlevel] 8.4.1 exit Thinking it could be fixed with the -gmt switch, I tried the following, and got the same numbers from clock scan, but got slightly different output from clock format: $ /bin/expect puts [clock scan "today 5pm" -gmt 1] 1103734800 set thetime [clock scan "today 5pm" -gmt 1] puts [clock format "$thetime" -gmt 1 ] Wed Dec 22 17:00:00 PST 2004 exit $ /bin/tclsh puts [clock scan "today 5pm" -gmt 1] 1103734800 set thetime [clock scan "today 5pm" -gmt 1] puts [clock format "$thetime" -gmt 1 ] Wed Dec 22 5:00:00 PM GMT 2004 exit It is notable that clock format spits out an army time under expect, but spits out a non-army time for tclsh. So, why is the output of clock scan different between expect and tclsh? Isn't expect using the same code as tclsh is using? thanks! Brett Gutt __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo