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!

Placing Expect command inside an existing Expect

Status
Not open for further replies.

RF101

Technical User
May 17, 2006
33
US
Current script:

set tdate [clock format [clock seconds] -format %Y%m%d]
set newName ofcvar_
append newName $tdate
append newName ".txt"
send "expect -f ofcvar.txt > $newName\r"

This gives me a new file like ofcvar_20080919.txt

When I type in the commands above at the expect prompt it works exactly like I wanted it but when I type the commands into a new tcl file and execute it it fails to send the last command successfully.

set tdate [clock format [clock seconds] -format %Y%m%d]
set newName ofcvar_
append newName $tdate
append newName ".txt"
send "expect -f ofcvar.txt > $newName\r"


I get this at the prompt:

xpect -f ofcvar.txt > ofcvar_20080819.txt

I am not getting the syntax right on the send command. I have tried several variations without luck.

Please help,

RF
 
Resolved. I decided to place everything in one script instead of trying to call a second one within the first.

Thanks,

RF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top