This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
expect and tclsh give different output from "clock scan"
- From: Brad Gutt <bgutt3 at yahoo dot com>
- To: insight at sources dot redhat dot com
- Date: Wed, 22 Dec 2004 09:20:02 -0800 (PST)
- Subject: expect and tclsh give different output from "clock scan"
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