Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 28th, 2003, 02:19 PM
quiknot quiknot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 10 quiknot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Expect/Tcl -- Need to access return value of script

Hi, I have an expect script that rlogin's to another system, and executes a few remote commands on that server. I need to capture the return value of one of the commands given, and then return that value to another script (the one that called the expect script). Here is a rough outline of my expect script:

#!/usr/bin/expect -f

set prompt "(%|#|\\$|%]) $"
catch {set prompt $env(EXPECT_PROMPT)}
set timeout 10
set username [lindex $argv 0]
set pword [lindex $argv 1]
set arg1 [lindex $argv 2]
set arg2 [lindex $argv 3]
set host "theserver@thehost.com"
spawn rlogin -l $username $host
expect "Password:*"
send "$pword\r" //Connected to remote host
expect -re $prompt
send "/path/to/the/script $arg1 $arg2 .. need return value of this script
expect -re $prompt
send "exit\r"
//need to return the return value found
exit

basically it is like this...I call the expect script from php (via exec), it runs on the same server as the webserver, then rlogin's to the other server and runs the scripts...I need to return the return value back to php, can I do this?
Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDev Shed Lounge > Expect/Tcl -- Need to access return value of script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT