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
CCD2ISO(1)							   User Commands							CCD2ISO(1)

NAME
ccd2iso - convert IMG format to ISO format SYNOPSIS
ccd2iso [FOO.IMG] [BAR.ISO] DESCRIPTION
ccd2iso converts FOO.IMG to ISO format and writes the result to BAR.ISO. If fewer arguments than expected are given, ccd2iso will print its help message and quit. If more arguments than expected are given, ccd2iso will silently ignore them and use only the first two argu- ments. IMG files are raw-data copies of optical media, generated primarily by the Windows application CloneCD, and are primarily used to store CDs with odd properties, such as sectors which need to have read errors when read. Conversion to ISO format removes this information, as ISO format does not support this. IMG files almost always include a SUB file, which contains additional data for the disc format, and a CCD file, which is a plaintext con- figuration file describing the disc layout. ccd2iso does not make use of these files, but the applications which generate them expect them to have the same FOO prefix as the IMG file. LIMITATIONS
ccd2iso currently only copies the first session of multisession discs, as well as outputting a harmless warning of Unrecognized sector mode. ccd2iso utterly ignores the additional data in CCD or SUB files. SEE ALSO
mdf2iso(1), nrg2iso(1) AUTHOR
This manual page was written by Rich Ercolani <rercola@acm.jhu.edu>, for the Debian GNU/Linux distribution (but it may, of course, be used by others), because the original program lacked a manual page. It may be distributed under the same terms as ccd2iso, the GNU GPL version 2 or later, at your option. ccd2iso 0.3 June 2006 CCD2ISO(1)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy