Sponsored Content
Top Forums Shell Programming and Scripting Expect: run a command first before sending Post 302372815 by trey85stang on Wednesday 18th of November 2009 10:23:46 PM
Old 11-18-2009
I know the answer is yes, but I don't know expect well enough to tell you how to do it. It is based off of tcl if you happen to know how script/program in tcl/tk.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect and auto expect command

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

Sending test pass to a folder in expect

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

Expect Script sending password with $ and symbols

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

How to run the following expect commands in a loop

#!/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

Use expect to run an interactive shell script?

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

sending content of a file in Expect

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

Cannot get this bash/expect script to run under a crontab

#!/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

Script for telnet and run one command kill it and run another command using while loop

( 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

Problem in sending inputs to format command using expect

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

How to run the following expect commands in a loop?

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
TGN(1)																	    TGN(1)

NAME
tgn - a network traffic generator SYNOPSIS
tgn [-V] [-v] [-l] [-s random seed] [-w PCAP filename] [-o output speaker] [-c packet count] [-h] [PDU definition] DESCRIPTION
tgn is a network traffic generator. It is command-line interface (CLI) program that does the same thing as the send_network command of the Network Expect framework. Refer to nexp(1) for additional details regarding the send_network command. The only mandatory option is a PDU definition. The -c switch allows to specify the number of packets to send. If -c is not provided then the number of packets to send is calculated automatically based on the PDU definition. -V causes tgn to print its version number and exit. The -s flag allows to specify a random seed that will cause predicatibility of pseudo-random numbers generated by tgn during execution of a script. In cases where tgn is used as a protocol fuzzer, this option is useful to be able to re-generate a specific test case. -v increases the verbosity level. Additional information may be displayed when the verbosity level is higher. The -l flag causes tgn to display all available network speakers and exit. See nexp(1) for a discussion of network speakers. The -o flag allows to select a specific network speaker for output. Use the -l option to list available speakers. By default, the "ip" speaker (kernel-routed IP packet delivery) is tried first and if it is not available, which can happen if tgn is not run with root privileges, the "hex" speaker is used. The PDU definition is a string that defines a PDU. It uses libpbuild PDU syntax. EXAMPLES
shell# tgn -o eth0 "ip(dst = 192.168.1.1)/icmp-echo(id = 'random')" shell# tgn "ip(src = 192.168.0.1, dst = <192.168.0.10, 192.168.0.11>,ttl = <1, 2>)/" "tcp(src = 'random', dst = 22..25, window = 16384,syn, seq = 'random', ack-seq = 0)" shell# tgn -w /tmp/cap -c 5 "ether()/ip(dst = 1.2.3.4++)/icmp-echo(seq = 0++)" && wireshark /tmp/cap BUGS
tgn has not been ported to Microsoft Windows. VERSION
This man page is correct for version 1.0 of tgn. SEE ALSO
nexp-numspec(1), nexp-payload(1), nexp-ether(5), nexp-gre(5), nexp-ip(5), nexp-mpls(5), nexp(1) AUTHOR
Network Expect was written by Eloy Paris <peloy@netexpect.org>. However, Network Expect borrows ideas from lots of Open Source tools like Nemesis, Packit, hping, Expect, and Scapy. The Network Expect author is indebted to the authors of these tools for their contribution. This man page was written by Eloy Paris. 09 September 2009 TGN(1)
All times are GMT -4. The time now is 02:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy