Sponsored Content
Top Forums Shell Programming and Scripting Want to get the output in windows Post 76354 by bakunin on Tuesday 28th of June 2005 03:15:56 AM
Old 06-28-2005
Sending the output "directly" to a windows process, without an intermittent file lke Vino already suggested, is hard to do. You will have to create some form of network communication over which to transport the information and would have to build some sender/listener on the windoze und the Unix side respectively. It would have to be a background process, to allow for the running script to continue while it listens/sends.

While this is not impossible the solution suggested by Vino seems far easier to implement. To achieve a pseudo-communication you could poll for that file and read only the lpart of the file you haven't processed yet. The general layout would look like:

Code:
while : ; do
     while [ -z "$(unprocessed_message)" ] ; do
           unprocessed_message="$(get_unprocessed_msg_somehow)"
          sleep 1
     done

     case $unprocessed_message in
          variant1)
               process_first_possible_message
               ;;

          variant2)
               process_second_possible_message
               ;;

          ...


          *)
               print - "unintelligible message encountered"
               ;;

     esac

     unprocessed_message=""     # reset msg after processing

done

The function get_unprocessed_message would somehow extract from the newly transferred output-file everything which hasn't been processed by the script already. For instance you could write every processed line to a "processed"-file and run "diff" (man diff) over it to get lines not already processed.

Hope this helps

bakunin
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

get the output of unix script in windows

Hai Actually I work on CVS, where the server is in UNIX and the front end(client) is windows. Now I want to run a script in unix and get the output(report) in windows. Can anyone help me in this as to how i can connect to dos..... Thanks (1 Reply)
Discussion started by: csrope
1 Replies

2. HP-UX

to put the unix script output on windows desktop

Hi could you pls guide a to automate that unix script output is avaialble on desktop.i can FTP and then download but i want to automate it. rgds (1 Reply)
Discussion started by: Assassin
1 Replies

3. UNIX for Advanced & Expert Users

Shell output to windows

Good day Guys, I have a problewm in one of my development project. I need to call a SAS job in my script. NO problem with this one, the problem is I need the output (an excel file) to be redirected to a windows server. The destination server is called pcfileserver. I dont know how to redirect... (2 Replies)
Discussion started by: sasia
2 Replies

4. UNIX for Dummies Questions & Answers

syslog files output to Windows

Hi there, Our syslog servers are unix. The files seems like local6 or somethign. How can I output the file to a file in Windows that I can maninupate? such as choose records that I am interested through the IP or time? Thanks, Margu. (2 Replies)
Discussion started by: margu
2 Replies

5. Programming

Printing Popen Output Using Windows 7

Hi Guys, I am new to python and I am trying to print ouput of Popen on my text screen (tkinter gui). I was able to make it work on Linux with this code: Linux: Working def PrintSomething2(): outputdata = commands.getstatusoutput("sudo fping -f host.list") for i in outputdata:... (2 Replies)
Discussion started by: tattoostreet
2 Replies
bdiff(1)                                                           User Commands                                                          bdiff(1)

NAME
bdiff - big diff SYNOPSIS
bdiff filename1 filename2 [n] [-s] DESCRIPTION
bdiff is used in a manner analogous to diff to find which lines in filename1 and filename2 must be changed to bring the files into agree- ment. Its purpose is to allow processing of files too large for diff. If filename1 (filename2) is -, the standard input is read. bdiff ignores lines common to the beginning of both files, splits the remainder of each file into n-line segments, and invokes diff on cor- responding segments. If both optional arguments are specified, they must appear in the order indicated above. The output of bdiff is exactly that of diff, with line numbers adjusted to account for the segmenting of the files (that is, to make it look as if the files had been processed whole). Note: Because of the segmenting of the files, bdiff does not necessarily find a smallest sufficient set of file differences. OPTIONS
n The number of line segments. The value of n is 3500 by default. If the optional third argument is given and it is numeric, it is used as the value for n. This is useful in those cases in which 3500-line segments are too large for diff, causing it to fail. -s Specifies that no diagnostics are to be printed by bdiff (silent option). Note: However, this does not suppress possible diagnos- tic messages from diff, which bdiff calls. USAGE
See largefile(5) for the description of the behavior of bdiff when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). FILES
/tmp/bd????? ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ SEE ALSO
diff(1), attributes(5), largefile(5) DIAGNOSTICS
Use help for explanations. SunOS 5.10 14 Sep 1992 bdiff(1)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy