It has been too long since I did expect programming but expect is really
an add on to TCL so you can't use bash/shell script type language you have to
get the arguments a la TCL.
Check out the expect
homepage http://expect.nist.gov/
it covers that question (and many others)
On Tue, 05 Sep 2000, Rick Teudt wrote:
> I am trying to figure out how to pass a command-line argument into an expect
> script.
>
> For example, suppose I have a script called update.exp. The first few lines
> of update.exp are as follows:
>
> #!/usr/bin/expect
>
> spawn $env(SHELL)
> expect "$ "
> send -- "telnet node$1\r"
> expect "login: "
> ...etc.
>
> I want to be able to execute the script from the command line with a single
> argument, and then use that argument as variable $1 in the script. So if I
> do this:
>
> $./update.exp 123
>
> the script will telnet to node123.
>
> The man pages suggest that this might be possible, but I haven't been able
> to make it work. If it matters, I'm using expect version 5.28.1.
>
> Any help would be appreciated.
>
> Rick Teudt
>
>
>
> _______________________________________________
> Redhat-devel-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-devel-list
--
Lars Nordin
Noble Systems Corporation
www.noblesys.com
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list