Sponsored Content
Top Forums Shell Programming and Scripting Help capturing output of expect script Post 302885151 by cityprince143 on Thursday 23rd of January 2014 08:19:36 PM
Old 01-23-2014
Input file :-

Image

It is reading correctly, but seems like buffer doesn't copy to "outcome".

I see the buffer filled with the content of the inputfile when i try running it in debug mode.

Code:
expect: set expect_out(0,string) "\u001b[3;32Htype C:\Users\Administrator\D\u001b[3;61Hesktop\inputfile.txt\u001b[5;1HSILENT = YES\u001b[6;1HIGNOREERRORS = ServerNotFound,BadPassword,FailedDependencies\u001b[7;1HSKIPTARGET = NO\u001b[8;1HSOURCEPATH = C:\Users\Administrator\Desktop\swpackages\u001b[9;1H[TARGETS]\u001b[10;1HHOST = 16.186.36.42\u001b[11;1HUID = Administrator\u001b[12;1HPWD = Administrator\u001b[13;1H[END]\u001b[14;1H[TARGETS]\u001b[15;1HHOST = 16.153.135.184\u001b[16;1HUID = Administrator\u001b[17;1HPWD = administrator\u001b[18;1H[END]\u001b[20;1HC:\Users\Administrator\Desktop>"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "\u001b[3;32Htype C:\Users\Administrator\D\u001b[3;61Hesktop\inputfile.txt\u001b[5;1HSILENT = YES\u001b[6;1HIGNOREERRORS = ServerNotFound,BadPassword,FailedDependencies\u001b[7;1HSKIPTARGET = NO\u001b[8;1HSOURCEPATH = C:\Users\Administrator\Desktop\swpackages\u001b[9;1H[TARGETS]\u001b[10;1HHOST = 16.186.36.42\u001b[11;1HUID = Administrator\u001b[12;1HPWD = Administrator\u001b[13;1H[END]\u001b[14;1H[TARGETS]\u001b[15;1HHOST = 16.153.135.184\u001b[16;1HUID = Administrator\u001b[17;1HPWD = administrator\u001b[18;1H[END]\u001b[20;1HC:\Users\Administrator\Desktop>"

* ignore those special character it's bcoz of VT100 conversion.
 

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
EXIM_CONVERT4R4(8)					      System Manager's Manual						EXIM_CONVERT4R4(8)

NAME
exim_convert4r4 - Convert Exim configuration from v3 to v4 format SYNOPSIS
exim_convert4r4 DESCRIPTION
This script is provided to assist in updating Exim configuration files. It reads an Exim 3 configuration file on the standard input, and writes a modified file on the standard output. It also writes comments about what it has done to the standard error file. It assumes that the input is a valid Exim 3 configuration file. A typical call to the conversion script might be exim_convert4r4 < /etc/exim/exim.conf > /etc/exim4/exim4.conf.new The output file MUST be checked and tested before trying to use it on a live system. The conversion script is just an aid which does a lot of the "grunt work". It does not guarantee to produce an Exim 4 configuration that behaves exactly the same as the Exim 3 configuration it reads. Each option change in the new file is preceded by an identifying comment. In fact, the conversion script tends to make quite a mess of your configuration, and you should expect to go through it afterwards and tidy it up by hand. Unless you are running a very straightforward configuration, the automatic conversion is likely to generate a non-optimal configuration. You should not only check it thoroughly, but also run as many tests as you can, to ensure that it is working as you expect. In particular, you should test address routing, using -bt and -bv, and the policy controls, using -bh. If possible, you should also do some live tests (i.e. send and receive some messages) before putting Exim 4 into service. If you have a very complicated configuration, it is possible that exim_convert4r4 will break it in some situations, which is why thorough testing is strongly recommended. BUGS
This manual page needs a major re-work. If somebody knows better groff than us and has more experience in writing manual pages, any patches would be greatly appreciated. SEE ALSO
exim(8), the files in /usr/share/doc/exim4-base/, especially Exim4.upgrade.gz AUTHOR
This manual page was stitched together from Exim4.upgrade by Andreas Metzler <ametzler at downhill.at.eu.org>, for the Debian GNU/Linux system (but may be used by others). March 26, 2003 EXIM_CONVERT4R4(8)
All times are GMT -4. The time now is 03:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy