Fedora Linux Support Community & Resources Center
  #1  
Old 9th October 2007, 04:26 PM
PhillyFloyd's Avatar
PhillyFloyd Offline
Registered User
 
Join Date: Jun 2007
Location: Washington DC
Posts: 338
call remote shell script within an expect script

Howdy

Here is the script:


Code:
#!/bin/bash
VAR=$(expect -c "
spawn scp /home/ncfuser/kimstest.sh awipsts1:/home
expect {
Password: { send \"access\r\"; exp_continue }
}
exit
")

VAR2=$(expect -c "
spawn ssh awipsts1
expect {
Password: { send \"access\r\"; exp_continue }
expect {
"#" { send \"./home/kimstest.sh\r\"; exp_continue }  <---- ISSUE IS HERE
}
}
exit
")

echo -e "\n$VAR\n\n Copy completed OK .. executing script\n\n"
echo -e "\n$VAR2\n\n Done Configuring XYPLEX\n\n"
So I can't get the kimstest.sh to run (in $VAR2) does anyone know how to call a shell script remotely using expect to ssh to the remote device?

Thanks guys/gals
__________________
"You're as useless as a jiffy in a tickless kernel."
Reply With Quote
  #2  
Old 16th October 2007, 04:46 PM
David Becker Offline
Registered User
 
Join Date: Feb 2006
Posts: 780
Better late than never:

I haven't used expect in years but I expect that the 'eval' function would help you here.

David
Reply With Quote
  #3  
Old 16th October 2007, 10:29 PM
PhillyFloyd's Avatar
PhillyFloyd Offline
Registered User
 
Join Date: Jun 2007
Location: Washington DC
Posts: 338
Thanks for the reply David
So the reason I was writing this was for a co-worker...once he explain what he wanted to do I realized I had a much easier way than what he was trying...

I tried the eval and it does work like a champ ... not a fan of expect, but configuring xyplex/cyclades terminal servers, it is just easier ;-)

thanks again
__________________
"You're as useless as a jiffy in a tickless kernel."
Reply With Quote
Reply

Tags
expect, remote, script, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TCL (expect) Script problem Jamwa Using Fedora 2 4th February 2009 05:07 AM
starting a shell script inside a php script gw348 Using Fedora 6 23rd April 2007 09:30 PM
telnet server not reliable for expect script powah Using Fedora 0 16th November 2005 05:10 PM
need to run script Bourne-shell script armen Using Fedora 4 4th April 2005 01:16 PM


Current GMT-time: 04:32 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat