![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Issue calling scripts through CRON. | vskr72 | Shell Programming and Scripting | 5 | 01-07-2008 08:12 PM |
| any possible solution on sql calling scripts | manas_ranjan | Shell Programming and Scripting | 4 | 11-22-2007 06:02 AM |
| Calling SQL LDR and SQL plus scripts in a shell script | rajagavini | Shell Programming and Scripting | 5 | 11-05-2007 06:12 PM |
| Calling functions in scripts directly | LiquidChild | Shell Programming and Scripting | 12 | 04-27-2007 06:28 AM |
| Expect and auto expect command | arun_v | Shell Programming and Scripting | 0 | 03-29-2006 07:31 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Calling expect scripts from other expect scripts
Hi,
First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts. Below is my test where I am trying to call b.exp from a.exp: a.exp #!/usr/bin/env expect # set timeout 5 spawn $env(SHELL) match_max 100000 send -- "./b.exp $spawn_id\r" expect "bla" expect eof exit b.exp #!/usr/bin/env expect # set spawn_id [lrange $argv 0 0] send -- "ls -al\r" expect bla I am passing the spawn_id into the b.exp script and then sending the "ls" command. The "ls" command does not output anything, so I understand that I can't pass just like that the handle to the process from one expect script to the other. Could you suggest any other approach to solve my original issue or maybe there's actually a way to talk to the same process from the distinct expect scripts? Thanks, Seva |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|