The expect tag has no wiki summary.
1
vote
0answers
28 views
Expect can not expect the output
I have problem with my simple code,
the expect can not expect the output
set timeout 10
set user username
set password password
spawn ssh $user@000.000.000.000
expect "Password:"
send "$password\r"
...
0
votes
1answer
75 views
Counting files on a remote server with ssh and an expect script
Below is my script to take count for files which are present in remote server.
But it is not working. Please help me.
#!/usr/bin/expect
spawn ssh sduser@172.0.0.2
expect "123"
send "123"
interact
...
0
votes
0answers
27 views
How to determine the max buffer capacity of linux/unix system for match_max value?
i wanted to know what is the buffer capacity of my linux/unix system when using match_max value in expect script
i am not sure whether ulimit is the correct command and i think max memory size below ...
0
votes
1answer
96 views
Run expect script from other shell
My target is to create the /var/tmp/add_user.bash script from /var/tmp/create_script_add_user.bash script
and run the expect script (add_user.bash) from create_script_add_user.bash script.
The ...
1
vote
1answer
88 views
How to safely put user typed password into a file?
Is there any way to put the password typed by user into a file (either in Unix or in expect).
read -s -p "enter password" input
echo $input > file
Is the above code safe?
I want to use that ...
2
votes
1answer
241 views
error handling in expect?
I am just improving my quetion becasue i have acieved so far upto this:
set username [lindex $argv 0]
set password [lindex $argv 1]
set hostname [lindex $argv 2]
if {[llength $argv] == 0} {
...
2
votes
2answers
414 views
Cross compiling expect for ARM
I have downloaded expect5.4 . I'm trying to cross compile it for ARM(PandaBoard) running stripped down version of linux.
In the initial setup of configuring , I try
Shell$ ./configure --host=ARM
...
0
votes
1answer
93 views
Is expect tool availabe for ARM platform
I need to get expect (tool for automating interactive applications) for the ARM platform. Is it a readily cross compiled to ARM and is it available? I tried googling but was unable to get the ...
2
votes
2answers
308 views
Using expect to send Ctrl+D to a telnet connection
I want to use expect file for connecting to telnet session automatically, the flow is:
when we connect to some IP & port, it will show escape character is ]
after that we have to give Ctrl+D
I ...
3
votes
1answer
2k views
sftp a file using shell script
I have read through several threads (which have been helpful) and I'm still getting an error when trying to sftp a file (client wants it to be sftp'ed)
Here is the script:
#!/bin/bash
...
1
vote
1answer
455 views
grep output of expect script
I'm trying to run some expect language, and grep/parse the output all in one script. I want to grep the output of and look for "error" (I should note that standard linux commands like awk, sed, grep, ...
0
votes
1answer
404 views
How to create auto vote script using `expect`?
I'd like to test auto-vote protection on my site (not published yet).
I've found Expect program, but I can't get it working with telnet http.
2
votes
1answer
302 views
How to get the PID from a spawned process in expect?
Example: In a shell script I open a SSH tunnel whit this:
/usr/bin/expect <<EOD
set timeout -1
spawn ssh -fNL localhost:1873:localhost:873 HOST
expect "*?assword:" { send "$SSHPASS\r"}
sleep 2
...
3
votes
2answers
318 views
encfs with expect access denied
If I execute script
#!/usr/bin/expect
set pass [lindex $argv 0]
spawn encfs -v {CRIPT_DIR} {MNT_DIR} -o nonempty
expect "*EncFS Password:*"
send "$pass\r"
expect eof
expect script output:
...
1
vote
2answers
177 views
Automate creation of an at job using expect
I am trying to write a script that will take time and process-name and pass them to at to schedule the job. I cannot send the EOT.
#! /usr/bin/expect
# Usage: setupkill.exp time process.
...
1
vote
2answers
2k views
SSH + Sudo + Expect in Bash script: Run command with sudo in remote machine
I am trying to automate the deploy of some .deb packages with an script. I want to execute sudo dpkg -i $myDeb.deb in a list of remote machines I can access with ssh.
I've tried to automate the ...
1
vote
2answers
438 views
How to meet required dependencies in order to install expect pecl extension on Mac OS X?
I am attempting to install the expect pecl extension.
OS version = 10.7.3
PHP version 5.3.10 installed via macports
expect version 5.45 installed via macports
The command I am executing:
...
2
votes
2answers
216 views
Regular expressions with ExpectJ
I've been used the ExpectJ Java library to automate some jobs on a Linux server, however now I need to automate a job that sends a different text response for each execution. Here is the output:
Last ...
1
vote
1answer
484 views
Run expect inside a bash script as another user
I am writing a bash script to install some small software I'm developing. That script is run with sudo (as root), but some of the commands that are executed by the script need (or should be) run with ...
3
votes
3answers
7k views
Shell Script for logging into a ssh server
I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code:
set timeout 30
/usr/bin/ssh -p 8484 ...
3
votes
4answers
770 views
passing passwords to a script
I want to scp a file to a remote host, and from there, run a command on the file, and exit the remote session. If I write a usual script, call scp and then ssh, I am prompted to enter two passwords. ...
2
votes
3answers
4k views
How to auto type password for SCP or SFTP to automate it?
I have script where I put scp command to backup file to other server. But when it runs it asking to type password. Is there way to automate this? I am using CentOS 5.6. I have seen few guides they use ...
2
votes
3answers
1k views
Pass the background flag (&) through expect and ssh
My command line/bash fu is extremely weak, but I'm trying to hone my abilities. Hopefully someone can help.
I wrote a super simple expect script so that I can SSH in to a headless box we're using at ...