Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command line arguements in expect

Status
Not open for further replies.

9anth3r

ISP
Sep 3, 2002
7
US
Just a quick little question,

How can i send command line arguemnets to an expect script

ex.
% ./myescript.exp arg1 arg2 arg3

Any help or links to a how-to's etc etc would be greatly appriciated.
 
Try this:
for {set x 0} {$x <= [llength $argv]} {incr x}
do_proc [lindex $argv $x]
}

 
You can try this one too:

#!/usr/local/bin/expect --

scan $argv &quot;%s %s %s&quot; var1 var2 var3
send_user &quot;var1: $var1 \n&quot;
send_user &quot;var2: $var2 \n&quot;
send_user &quot;var3: $var3 \n&quot;


EDC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top