I am trying to use a very simple expect script to automate entering one or two details into a console connection of a solaris machine so that I can do a boot net - install.
If I run the console connection script manually myself, it connects fine and when I hit enter, I am on the machine and can log in etc.
Problem is, when I spawn this exact same command from within expect, the connection seems to work but when I hit enter, nothing
What might be different about spawn, than running script from the command line.
You don't need double \r\r statement, one carriage return is OK, also, set the timeout to indefinite with : set timeout -1
Your machine may be experiencing slow responses, so rule that out. You can also try autoexpect too that comes with the expect installation.
I'm fairly new to scripting so this might not be possible.
I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version:
#show version
... (0 Replies)
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Two SPARC servers running latest patches on S10U11. When the mysql account logs into either machine from a windows 7 workstation via putty or other ssh program, the first attempt works fine. Trying to ssh in from the same terminal a second time using either the mysql account or any other LDAP... (5 Replies)
I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues:
set REMOTE "/root/scripts/remote"
...
log_user 1
send_user "Executing remote script as $user...\n"
send_user "Command to execute is: $REMOTE... (1 Reply)
Hi,
Am very new to expect scripting..
Can You please suggest me how to call an expect script inside another expect script..
I tried with
spawn /usr/bin/ksh
send "expect main.exp\r"
expect $root_prompt
and
spawn /usr/bin/ksh
send "main.exp\r"
expect $root_prompt
Both... (1 Reply)
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Good Morning Fellow Admins!
I have a v880 running Sol9. The cron daemon is executing a crontab for a user and the user is in /etc/cron.d/cron.deny.
/etc/cron.d/cron.allow exists and the user is not in it.
What am I missing?
Thanks in Advance!
Tony (3 Replies)
Hi
I've stumbled over something that caught my attention but I'm not familiar enough with IPs to know if this is suspect or irrelevant. If you'd take the time to read and respond I'd greatly appreciate it. I'm just stumped.
I've done a site for some people (4 in the group) awhile ago and set... (4 Replies)