Questions tagged [expect]

80 questions
1
vote
1 answer

expect script running screen stops working when run by cron

I hope this question is OK for this forum. I have a device, a modem. I talk to this modem with the linux program "screen" as a terminal program. I invoke it like this "/usr/bin/screen /dev/tty6". I need to send about 6 commands per session or so. …
k-h
  • 139
  • 4
1
vote
2 answers

#!/usr/bin/expect not working

This is probably an easy question, however have a simple expect script that I've add the executable bit to that seems to be ignoring the #!/usr/bin/expect interpreter line. Further more, it also seems like variables are not being set since when I…
Jim
  • 988
  • 7
  • 20
  • 33
1
vote
1 answer

expect: how to use expect scripts from within a bash subroutine

I want to write a login script in expect. But I want this to be reused in different other scripts. I want to make all the login commands part of a bash subroutine. ie instead of expect_login.sh #!/bin/usr/expect -f spawn .... set .... I want…
user285825
  • 111
  • 1
  • 3
1
vote
2 answers

Error while installing php extension 'expect'

I got some serious error while installing expect extension in PHP. I ran sudo pecl install channel://pecl.php.net/expect-0.3.1 I got error like this while running make, running: make /bin/bash…
Uvais Ibrahim
  • 11
  • 1
  • 3
1
vote
1 answer

expect script works fine standalone not from bash script

I am running a expect script,which login to a server check if iptables running and return the log file of the status. There is a hostfile also given with server list and password, expect is being called from a shell script which it sending correct…
1
vote
1 answer

expect script not working with bash script

I want a script that ssh to remote server and then run a script which is at my local machine and then store the output on my local machine Expect script for ssh to remote server: #!/usr/bin/expect -f set Timeout 2 set IPaddress…
nis
  • 11
  • 1
  • 3
1
vote
1 answer

expect script + how to perform case in expect script

the following expect script target is to print the hostname name from linux/solaris machine and according to hostname results expect script will run linux.ksh or solaris.ksh script expect_sun_script=`cat << EOF set timeout -1 spawn telnet 0…
yael
  • 2,433
  • 5
  • 31
  • 43
1
vote
1 answer

How to listen for SNMP Traps from SNMP enabled network devices?

I just began working for my school's networking department, and I was assigned a project to develop a program to listen for traps from SNMP network devices. The device I am testing with an Access Point Cisco Aironet 1242, I have been looking on line…
ILikeTacos
  • 113
  • 3
1
vote
1 answer

ssh + multiple ssh connection failed

I have 47 Linux client machines and one Solaris server machine (all Linux client machines are red-hat 5.1) all clients perform ssh connection to the server in order to verify if /tmp/generic_error.txt exist in the server clients do the ssh…
Eytan
  • 611
  • 6
  • 13
  • 27
1
vote
3 answers

Scripting around Curses?

I have a process I'm that I'm constantly having to deal with. It requires I run a command and then enter several pieces of information. Then I'm presented with a curses menu listing several options. The first half is easy to automate using…
Tabitha
  • 1,005
  • 1
  • 8
  • 14
1
vote
2 answers

Setup a minimum workable Linux server on PC and get private IP address

The scenario is I want to use Expect to automatize some daily routine tasks to check log servers with private IP addresses. Telnet/SSH to those servers from a Linux server with public IP address won't work. Any way to set up a workable linux…
Andrew
  • 113
  • 1
  • 5
  • 14
1
vote
2 answers

Linux Expect Script terminates too early

I have an expect script that I have written that at the end calls scp to copy a large file from server A to server B. The issue I have (which is the same using rsync and not scp) is that the expect script is terminating before the file transfer is…
aHunter
  • 314
  • 1
  • 6
  • 21
1
vote
1 answer

What is wrong with my expect script?

I'm trying to learn how to use the expect command, to help me automate deployment of some software via shell scripts, and figured I start with something simple to get me started. I've created a file in my home dir called 'foo' using: touch foo And…
Bryan
  • 7,628
  • 15
  • 69
  • 94
1
vote
1 answer

Using expect to automate Alpine Linux installation in FreeBSD in Bhyve

I am attempting to automate installation of Alpine Linux in vm-bhyve under FreeBSD and expect dies shortly after the boot menu times out and launches the Alpine Linux installation. #!/usr/bin/env expect spawn vm install -f alpine alpine.iso #…
Walter
  • 243
  • 2
  • 6
1
vote
1 answer

Merging Expect script and Bash script

This is my expect script for login into a remote server.where i ask user to put password. #!/usr/bin/expect -f #Grabbing Password to be used in script further stty -echo send_user -- "Enter the Password: " expect_user -re "(.*)\n" send_user…
GauravG
  • 19
  • 7