All Questions
6
questions
0
votes
1
answer
336
views
expect spawn command: Escaping newline (\n) in string
I am trying to use expect to interact with the MATLAB console. Currently I have:
#!/usr/bin/expect -f
spawn {*}/usr/bin/run.sh matlab -r "fprintf(1, \"The identifier was:%s\\\\n\", \&...
2
votes
1
answer
5k
views
expect -timeout vs. "set timeout" in expect: Different behavior
I was testing a expect script and found two different behaviors when using set timeout vs. expect -timeout. Here is a simple example
response.sh:
#!/usr/bin/bash
sleep 2
echo hello
test1.sh:
#!/usr/...
0
votes
1
answer
1k
views
How do I build a script shell to send cmd via telnet and log only results?
I would like to make a shell script that can call a range of IPs via telnet, to send a command, and write the result to a file.
1
vote
1
answer
2k
views
Expect and sudo timeout
I have a main shell script that prompts the user for his password. I then would like to call an expect script while passing the password to it. This expect script will run 3 sudo commands.
I know the ...
14
votes
1
answer
121k
views
What is the meaning of the "spawn" command in Linux (Centos6)
I need to know how to set up a cron job that automatically connects to a remote server, then changes to a directory and downloads all the files in that directory to local.
I think I have to use SFTP ...
5
votes
3
answers
11k
views
How to by-pass user interactions in a script?
I am trying to automate the installation of a program through a shell script. There are a few steps which require user interaction from the command line (confirmation, yes/no, etc.). What is the best ...