Sponsored Content
Top Forums Shell Programming and Scripting How to execute a program at expect script Post 302332775 by zaxxon on Friday 10th of July 2009 04:10:00 AM
Old 07-10-2009
I am not using expect but having a short look into some tutorial I saw they often use \r when sending commands which looks like a enter stroke or something, like
Code:
send "./son\r"

If still nothing gets executed maybe try to add an "exec" inside the quotes in front of "son\r".

Check this
DeBaan: Simple expect ssh example
or any other of the 32.800.000 hits you get when you google for "expect tutorial".
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

2. Shell Programming and Scripting

C program to execute shell script

Hi, Can anyone pls give a sample to execute a shell script from C program Thanks (2 Replies)
Discussion started by: baigmd
2 Replies

3. Programming

C program to execute shell script

Hi, Can anyone give me a sample code to execute shell script from C program. Thanks (6 Replies)
Discussion started by: baigmd
6 Replies

4. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

5. Shell Programming and Scripting

expect telnet script execute by cronjob

hi, please help, keep getting this bolded error and look it up and people say its your environment variable though i tried to set it manually in expect..it run fine if i run it manually but once i run it by cronjob it error below..i tried to comment out ip/login info with *.. logfile:: START... (0 Replies)
Discussion started by: cssanangeles
0 Replies

6. Shell Programming and Scripting

how to execute a unix shell script from a java program

Hi All, well , i am facing this problem.. i have tried a few sample codes but there isn't any solution . could anyone please give a sample code as of how to do this... Please see the below details...and read the details carefully. I have written some code, logic is 1)from... (4 Replies)
Discussion started by: aish11
4 Replies

7. UNIX for Dummies Questions & Answers

Bash script to execute a program to rename files

I just can't figure it out , so please just give me a pice of advise how to: The existing Linux program foo2bar takes as its only argument the name of a single foo file and converts it to an appropriately-named bar file. Provide a script that when executed will run foo2bar against all foo... (4 Replies)
Discussion started by: raymen
4 Replies

8. Shell Programming and Scripting

Expect script to execute a script on a remote host

Hi, I am new to the expect scripting. I have this expect script as below : spawn ssh remote_server -l id set pass "12345" set opt "s" expect "Password:" {send "$pass\r" ; } expect "*ENTER*" {send "Enter\r"; exp_continue } expect "Please select option :" {send... (2 Replies)
Discussion started by: curt137
2 Replies

9. Red Hat

Execute expect script during firstboot

closed (1 Reply)
Discussion started by: AbhishekAgrawal
1 Replies

10. Shell Programming and Scripting

How to execute commands on remote server using expect script?

I need to copy python script file to around 100 servers using expect script. 1. Copy script to my user home first(/home/myhome) on each remote server 2. change permissions on copied file to 766. 3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Discussion started by: kchinnam
1 Replies
BEL(1)                                                                                                                                      BEL(1)

NAME
bel - open a shell or execute a command on a remote computer through several machines SYNOPSIS
bel [-e file] [-s file] [-d delay] DESCRIPTION
bel generates a script allowing the user to open a shell or execute a command on a remote computer through several machines. In order to generate the script, the user gives the paths to the different machines until the final one is reached. Several paths may be specified in a single entry file or through the standard input. OPTIONS
-e, --entree=FILE Provide the necessary information to establish the tunnel between the source and the final computer. -s, --repertoire-sortie=DIRECTORY The directory where you want to put the generated scripts. -d, --delai=SECONDS Delay to wait before each sent command, in seconds. AUTHOR
Carl Chenet <chaica@ohmytux.com[]> RESSOURCES
Belier homepage : http://www.ohmytux.com/belier LICENSE
Copyright (C) <2009> <Carl Chenet>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. 05/16/2009 BEL(1)
All times are GMT -4. The time now is 07:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy