Sponsored Content
Top Forums Shell Programming and Scripting Help capturing output of expect script Post 302885023 by cityprince143 on Thursday 23rd of January 2014 06:00:59 AM
Old 01-23-2014
Help capturing output of expect script

Code:

match_max 500000
set timeout 30

set outcome1 {}
set outcome2 {}
set inputfile C:\\Users\\Administrator\\Desktop\\inputfile.txt
send -i $con "\r";
expect -i $con "Desktop>" {
exp_send "type $inputfile \r"
}
set timeout 30
 
expect {
		"Desktop>" { set outcome $expect_out(0,string);}
		timeout { puts "i am timing out !!!\n"; }
        }

expect "Desktop>"

puts "Outcome1 = $outcome1\n"
puts "Outcome = $outcome\n"
send "exit\r"



I am trying to capture result of
"type C:\Users\Administrator\Desktop\\inputfile.txt "
outcome is returning empty. Smilie

Help is really appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capturing output in script

I have the following line in my script: $sftpcmd $rmthost <<COMMANDS>> $sftplog 2>&1 For some reason this is not capturing the errors from sftp, they go to the file attached to the cron entry ie mm hh dd MM * /myscript > cron.out any idea why? digital unix 4.0d (6 Replies)
Discussion started by: MizzGail
6 Replies

2. Shell Programming and Scripting

Capturing shell script command output

I am trying to check to see if a file exists on a ftp server, well, I know that cant be done, atleast directly, So I came up with this small script ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD cd public_html/crap dir $FILE quit END_SCRIPT Where the $ variable... (2 Replies)
Discussion started by: designflaw
2 Replies

3. Shell Programming and Scripting

capturing line from script output and appending to a file

Hi all, I did some searching in this forum but can't find anything that matches the issue I'm bumping heads with. On a CentOS4/Postfix (and bash everywhere) mail gateway box I run a command periodically to purge the Postfix queue of messages "From:MAILER-DAEMON". This is the one line'r... (6 Replies)
Discussion started by: wally_welder
6 Replies

4. Shell Programming and Scripting

Capturing Sybase SP output in Shell Script

Greetings, I need to capture the output of a Sybase stored procedure, inside my shell script( k shell). Based on this output, I need to call another perl script, with input arguments as the result set of the procedure execution. I need to keep looping through and call the perl script, ... (2 Replies)
Discussion started by: rajpreetsidhu
2 Replies

5. Shell Programming and Scripting

Problem capturing output in TCL script

I have a TCL script that logs into a switch using expect.I send a command "show port-security address" and it returns a table having a large number of rows.I need to capture this output(the table) and store it in a .txt file. I have done this: match_max 5000 set expect_out(buffer) {} set... (0 Replies)
Discussion started by: plasmalightwave
0 Replies

6. Shell Programming and Scripting

Capturing output of procedure in variable in shell script

Hi guys I am calling one DB2 stored proc through unix. It is giving me below output. I want to capture the value 150 in one UNIX variable in shell script. Please let me know how I can achieve this. Thanks in advance Value of output parameters -------------------------- Parameter Name :... (5 Replies)
Discussion started by: vnimavat
5 Replies

7. Shell Programming and Scripting

Capturing script output and input to log

Hi Is there a way that I can capture a shell script (both output and input) to a log file where I can analyze it? Thanks (6 Replies)
Discussion started by: nimo
6 Replies

8. Shell Programming and Scripting

How do I use grep output in an expect script?

Hi, I am using expect to ssh to a remote host and run a program on the remote machine which has a variable runtime. I need to wait until it finishes so I can grab the output file of this program. I am trying to use the output of grep to know when the process finishes. I am trying to capture... (0 Replies)
Discussion started by: vagabond1964
0 Replies

9. Shell Programming and Scripting

Expect Script - Not Seeing Output from While Loop

I know something simple is missing here, "log_user 1" is set . . . after this utility opens ${InFile} (handle? for IntInFile) it needs to look for something to appear in the file ${IntInFile} and then send it to the spawned process. Then I am locking the file ${IntInFile} and clearing it out -... (0 Replies)
Discussion started by: JuanMatteo
0 Replies

10. Shell Programming and Scripting

Capture output from expect script

Hi I am new to Expect scripting. I have to connect to a remote server and capture the output. Here I need output of " send "list registered\r"" to be stored in a file. but after execution, /tmp/capture.txt is of 0 byte #!/usr/bin/expect spawn ssh abc@10.10.10.10 -p 5022 expect... (2 Replies)
Discussion started by: bns928
2 Replies
aoecfg(8)						      System Manager's Manual							 aoecfg(8)

NAME
aoecfg - manipulate AoE configuration strings SYNOPSIS
aoecfg [-c cmd] [-s cfgstr] [-t timeout] [shelf slot] [netif] DESCRIPTION
Aoecfg(8) sends AoE configuration commands that control the retrivial, conditional or unconditional setting of AoE configuration strings. Since configuration happens before the MAC address of the target is known, the packet is broadcast. AoE targets with a matching shelf and slot respond. Since the default shelf and slot are the wildcard values 0xffff and 0xff, with no arguments aoecfg(8) will return configura- tion strings from all targets visible on the default interface, eth0. OPTIONS
-c cmd specify the AoE configuration command. The default is read. The available commands are read Read the server config string without performing any test and respond. test Respond only if the specified string exactly matches the server configuration string. prefix Respond only if the specified string is a prefix of the server configuration string. set If the current server config string is empty, set the server config string to the argument string and respond. If the current server config string is not empty, return a response with Flags bit E set and Error set to 4. fset Force set the server config string to the argument string and respond. -s cfgstr specify the config string. -t timeout specify the timeout in seconds. The default is no timeout. If neither the shelf nor the slot are specified, aoecfg(8) will exit after the first result. Otherwise, aoecfg(8) will exit only after the timeout has expired since it does not know how many responses to expect. shelf slot specify the shelf and slot used in the query. If unspecified, they default to broadcast. netif specifiy the network interface. The default is eth0. SEE ALSO
aoe-discover(8), aoe-interfaces(8), aoe-mkdevs(8), aoe-mkshelf(8), aoe-stat(8), aoeping(8), AoE (ATA over Ethernet): http://sup- port.coraid.com/documents/AoEr10.txt, ATA specification AUTHOR
Erik Quanstrom (quanstro@coraid.com) aoecfg(8)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy