![]() |
|
|
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 |
| Expect Script - No End | domi55 | Shell Programming and Scripting | 1 | 02-22-2009 12:45 PM |
| strange expect script behavior, or am i misunderstanding expect scripting? | v1k0d3n | Shell Programming and Scripting | 2 | 12-10-2008 04:31 PM |
| expect question | pbaets01 | UNIX for Dummies Questions & Answers | 4 | 11-04-2008 03:40 PM |
| Using expect script in a shell script or vice versa | nua7 | Shell Programming and Scripting | 0 | 07-18-2008 08:16 AM |
| question regarding EXPECT | finnje | Shell Programming and Scripting | 2 | 02-04-2005 10:23 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Question about an expect script
I am using Expect to spawn a command that loops through a text file and runs the same command for each item in the text file.
The text file, named stat.txt looks something like this: 2007-04 alist 543 2008-07 blist 543 2008-03 xlist 345 2008-03 ylist 675 2003-03 zlist 567 The expect script looks like this: #!/usr/bin/expect set timeout 600 set input [open "/tmp/stat.txt" "r"] while {[gets $input line] != -1} { ##################################### # separates agency code from listname ##################################### set datecreated [lindex $line 0] set listname [lindex $line 1] set agency [lindex $line 2] set newfile $listname.members.$agency.$datecreated spawn /usr/local/mailman/bin/list_members -o /tmp/lists/test/$newfile $listname } close $input --------------------------------------- The script looks at the 'listname' field in the text file, spawns the command 'list_members' for each one and creates a separate file for each, containing the email addresses of those on the list. The script works as I want until it gets to the listname beginning with 'y'. When I run the script, I see the spawning until the end, as if it actually creates a file for each listname. However, when I do a listing on /tmp/lists/test, there are no files beyond the 'x' name. Is there a way I can see why the spawn is not working for those particular items, even though it appears that it is? Thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|