Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sleep command for Expect

565 views
Skip to first unread message

Lydie

unread,
Nov 4, 2003, 10:14:44 AM11/4/03
to
Hello everybody,

I guess I can ask my expect question in this forum (maybe I am
wrong?).
In my expect program I need to execute the sleep command. In the
Exploring Expect book, it's written that the way to do that is just to
execute: sleep <#seconds>. So I did it. Unfortunately it failed.
Result: I need to use exec or system to do it. Is it a known problem?
Maybe it's not supported with the expect version I have (who knows?)
Version: 5.1.3.

Lydie.

Bud Beacham

unread,
Nov 4, 2003, 10:45:41 AM11/4/03
to

"Lydie" <dec...@lucent.com> wrote in message
news:94944999.03110...@posting.google.com...

Sleep works fine. I have never heard of any problem with it.

What platform (Linux/Unix/Windows) are you using? How does it fail? Can
you provide a code example?


Lydie

unread,
Nov 5, 2003, 7:32:45 AM11/5/03
to
"Bud Beacham" <buddXXXXXXXX@LEAVE_ME_ALONEix.netcom.com> wrote in message news:<FQPpb.7411$qh2....@newsread4.news.pas.earthlink.net>...

The platform is HP Unix.
Example of code: sleep 10 (like in Unix)
Error:
invalid command name: "sleep"
while executing
"sleep 10"

Could it be possible that the Expect interpreter on my system has been
modified? Is it possible? How can I check?

Lydie.

Roger J. Meier

unread,
Nov 5, 2003, 11:29:32 AM11/5/03
to
> > Maybe it's not supported with the expect version I have (who knows?)
> > Version: 5.1.3.

This version number is pretty unknown to me. The oldest one
I could find in my archive was 5.26, dated somewhere in 1997.

Are you sure you are running expect?

The "sleep" command is of course not implemented in Tcl --
maybe you didn't load the Expect extension? Try the command

package require Expect

in an interactive Tcl session and check the output (should
print a version number).


-- Roger

bb

unread,
Nov 5, 2003, 4:37:28 PM11/5/03
to
dec...@lucent.com (Lydie) wrote in message news:<94944999.03110...@posting.google.com>...


Well, that isn't much of a code example. I assume that the sleep
command is used in conjuncton with other Expect commands, such as send
and expect, and that the other commands work fine.

If so, and if you inherited the computer you are using, then your
guess about Expect being modified seems reasonable.

I just tried this test and it showed that sleep is a command available
to the interpretor.

[robot@Medea]$ tclsh
% load /usr/local/lib/libexpect5.38.so
% ?
ambiguous command name "?": after append array auto_execok auto_import
auto_load auto_load_index auto_qualify binary break case catch cd
clock close concat continue debug disconnect encoding eof error eval
exec exit exp_close exp_continue exp_debug exp_disconnect exp_exit
exp_fork exp_getpid exp_inter_return exp_interact exp_internal
exp_interpreter exp_log_file exp_log_user exp_match_max exp_open
exp_overlay exp_parity exp_pid exp_remove_nulls exp_send
exp_send_error exp_send_log exp_send_tty exp_send_user exp_sleep
exp_spawn exp_strace exp_stty exp_system exp_timestamp exp_trap
exp_version exp_wait expect expect_after expect_background
expect_before expect_tty expect_user expr fblocked fconfigure fcopy
file fileevent flush for foreach fork format getpid gets glob global
history if incr info inter_return interact interp interpreter join
lappend lindex linsert list llength load log_file log_user lrange
lreplace lsearch lsort match_max namespace open overlay package parity
pid proc prompt1 prompt2 puts pwd read regexp regsub remove_nulls
rename return scan seek send send_error send_log send_tty send_user
set sleep socket source spawn split strace string stty subst switch
system tclLog tell time timestamp trace trap unknown unset update
uplevel upvar variable vwait wait while
%


Try loading the latest versions of TCL and Expect and see if the
problem is still there.

bb

0 new messages