11-18-2009
Expect: run a command first before sending
Hello Expect experts,
Is it possible with Expect to run a command first when an expected phrase is
outputted by a spawned program? Before sending an answer to the spawned program that is...
Thanks a lot.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to run a remote application(GUI) in a client.i.e on running a script in the client machine i should get the GUI application which is running in the server by providing password through the script.Will expect or autoexpect command suit for this scenario?
could anyone help me by posting some... (0 Replies)
Discussion started by: arun_v
0 Replies
2. Shell Programming and Scripting
still new to this expect
useing bach shell to cammand expect script i tink i have that right!
i want to have the test im running upon every complted cycle copyed to a folder. cant seem to get it to work.
Ive tryed
log_file -a $globallogdir/deveoper.log
proc dbglog {notsure what... (0 Replies)
Discussion started by: melvin
0 Replies
3. Shell Programming and Scripting
All,
I am trying to use expect to send SFTP password because I am unable to share a key with the vendor.
They gave me a password that uses some symbols in it like $ and !
When i try to use the send command in expect it thinks the $ is a variable.
Is there anyway to have it send the... (2 Replies)
Discussion started by: markdjones82
2 Replies
4. Shell Programming and Scripting
#!/usr/bin/expect
spawn telnet 1.1.1.1
expect login*
send “admin\r”
expect Password*
send “abcdef123\r”
expect “Router#”
send “exit\r”
I want the above code to run in a loop such that script keeps doing a telnet to the device. Please suggest
Tarun (1 Reply)
Discussion started by: tkhanna82
1 Replies
5. Shell Programming and Scripting
Hi all,
I have a bit of a vexing issue here and I'm not certain how best to go about it. Basically, I want to run a shell script and automate the user prompt of hitting 1 to fully uninstall Symantec Anti-Virus for OS X.
Would expect be the best way to do this? (5 Replies)
Discussion started by: prometheon123
5 Replies
6. Shell Programming and Scripting
How Can I send the content of a file in Expect? Do I have to use cat command in a way? if yes how? lets say my file is called 1.txt.
example:
expect "Enter command to send:" {send "???? \r"} ???? --> content of the file 1.txt (1 Reply)
Discussion started by: alireza6485
1 Replies
7. Shell Programming and Scripting
#!/bin/bash
#
# RAP configuration script
#
# Usage: ./rap.sh
#
# Requires: expect, tcl
#
# Script expects to find a file called rap.csv located in the same directory as the script. If the file is placed
# in a different directory, modify the custom entries section to specify the absolute... (8 Replies)
Discussion started by: mrkool
8 Replies
8. Shell Programming and Scripting
( sleep 3
echo ${LOGIN}
sleep 2
echo ${PSWD}
sleep 2
while read line
do
echo "$line"
PID=$?
sleep 2
kill -9 $PID
done < temp
sleep 5
echo "exit" ) | telnet ${HOST}
while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies
9. Shell Programming and Scripting
Hi ,
I am not able figure out how to use expect tool to send input to this prompt of format
Searching for disks...done
selecting c0t3d0
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition... (3 Replies)
Discussion started by: chidori
3 Replies
10. Shell Programming and Scripting
spawn fbat
expect ">>"
send "log fbatPW80_OR8sim1 \r"
expect ">>"
send "load map.map \r"
expect ">>"
send "load fbatPW80_OR8sim1.ped \r"
expect ">>"
send "fbat -v1 \r"
expect ">>"
send "log off \r"
expect ">>"
I need the above code to run in a loop such that script keeps doing a... (1 Reply)
Discussion started by: zoeli
1 Replies
LEARN ABOUT DEBIAN
pbsdsh
pbsdsh(1B) PBS pbsdsh(1B)
NAME
pbsdsh - distribute task to nodes under pbs
SYNOPSIS
pbsdsh [-c copies] [-o] [-s] [-u] [-v] program [args]
pbsdsh [-n node] [-o] [-s] [-u] [-v] program [args]
pbsdsh [-h nodename] [-o] [-v] program [args]
DESCRIPTION
Executes (spawns) a normal Unix program on one or more nodes under control of the Portable Batch System, PBS. Pbsdsh uses the Task Manager
API, see tm_spawn(3), to distribute the program on the allocated nodes.
When run without the -c or the -n option, pbsdsh will spawn the program on all nodes allocated to the PBS job. The spawns take place con-
currently - all execute at (about) the same time.
Users will find the PBS_TASKNUM , PBS_NODENUM , and the PBS_VNODENUM environmental variables useful. They contain the TM task id, the node
identifier, and the cpu (virtual node) identifier.
OPTIONS
-c copies
The program is spawned on the first Copies nodes allocated. This option is mutual exclusive with -n.
-n node
The program is spawned on one node which is the node-th node allocted. This option is mutual exclusive with -c.
-h hostname
The program is spawned on the node specified.
-o Capture stdout of the spawned program. Normally stdout goes to the job's output.
-s If this option is given, the program is run in turn on each node, one after the other.
-u The program is run once on each node (unique). This ignores the number of allocated processers on a given node.
-v Verbose output about error conditions and task exit status is produced.
OPERANDS
The first operand, program, is the program to execute.
Additional operands, args, are passed as arguments to the program.
STANDARD ERROR
The pbsdsh command will write a diagnostic message to standard error for each error occurrence.
EXIT STATUS
Upon successful processing of all the operands presented to the command, the exit status will be a value of zero.
If the pbsdsh command fails to process any operand, or fails to contact the MOM daemon on the localhost the command exits with a value
greater than zero.
SEE ALSO
qsub(1B), tm_spawn(3B)
Local pbsdsh(1B)