From: Chris Albert <christopher.albert@sympatico.ca>
To: Russell Coker <russell@coker.com.au>
Cc: selinux@tycho.nsa.gov
Subject: Re: expect
Date: Sat, 26 Oct 2002 17:32:15 -0400 [thread overview]
Message-ID: <3DBB09DF.2020303@sympatico.ca> (raw)
In-Reply-To: 200210262252.30567.russell@coker.com.au
Russell Coker wrote:
>I want to run an expect script as:
>script program param1 param2 ...
>
>Then have the script spawn "program param1 param2" (sort of like "$@" in a
>bash script). How do I do this? Expect wants to combine all the parameters
>into a single parameter that contains spaces. How can I solve this?
>
>Also I want to do it for a varying number of parameters (so having an entry
>for each parameter isn't going to work).
>
>The aim of this is to provide the open_init_pty functionality. The version I
>posted to the list before will work for the basic SE functionality (IE
>Slackware type support). But for Debian support (and for full RPM support
>when someone implements it) we need to have open_init_pty run dpkg to install
>packages (and we can install multiple packages at the same time).
>
>
>
Russel,
Is is as you woud ex... imagine-- argv.
$expect script param1 param2 ... paramn
All the parameters are found in the list 'argv' , so if in script
...
set argc [llength $argv]
for (set i 0) {$i < $argc} {incr i} {
puts "arg $i: [lindex $argv $i]"
}
...
Then the script will spit out:
...
arg 0: param1
arg 1: param2
...
arg n: paramn
...
As in D.Libes' "Exploring Expect" (Oreilly)
Chris
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2002-10-26 21:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-26 20:52 expect Russell Coker
2002-10-26 21:32 ` Chris Albert [this message]
2002-10-26 22:07 ` expect Russell Coker
[not found] ` <3DBB2043.2010709@sympatico.ca>
2002-10-26 23:26 ` expect Russell Coker
-- strict thread matches above, loose matches on Subject: below --
2002-11-29 20:02 expect Stephen D. Smalley
2002-12-01 12:08 ` expect Russell Coker
2002-12-02 14:09 ` expect Jesse Pollard
2002-12-02 14:58 ` expect Russell Coker
2002-12-02 17:34 ` expect Tom
2002-12-02 19:40 ` expect Russell Coker
2002-12-02 22:00 ` expect Tom
2002-12-03 11:46 ` expect Russell Coker
2002-11-29 15:43 expect Russell Coker
2002-10-27 19:44 expect Russell Coker
1999-03-12 12:15 Expect Dean Takemori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DBB09DF.2020303@sympatico.ca \
--to=christopher.albert@sympatico.ca \
--cc=russell@coker.com.au \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.