public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* expect and tclsh give different output from "clock scan"
@ 2004-12-22 17:20 Brad Gutt
  2005-01-05 23:14 ` Keith Seitz
  0 siblings, 1 reply; 6+ messages in thread
From: Brad Gutt @ 2004-12-22 17:20 UTC (permalink / raw)
  To: insight

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 <format>" 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 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-21 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-22 17:20 expect and tclsh give different output from "clock scan" Brad Gutt
2005-01-05 23:14 ` Keith Seitz
2005-01-09 21:52   ` Brad Gutt
2005-01-10  1:20     ` Christopher Faylor
2005-02-20  7:29       ` Brad Gutt
2005-02-21 16:16         ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).