communication between two scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arepi
    New Member
    • Sep 2008
    • 62

    communication between two scripts

    Hi!

    I have 2 scrpits.How can I make the Script1 standard output be the Script2 standard input,during all run? I have Windows XP.

    Thanks!
    Last edited by Arepi; Sep 29 '08, 06:14 PM. Reason: more information
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    You would have to use piping. Not sure if this works on a DOS command prompt, but in a Linux shell at least, you would type:

    Code:
    script1.pl | script2.pl

    Comment

    • Arepi
      New Member
      • Sep 2008
      • 62

      #3
      Thanks for your help but it really doesnt work.The first scipt begin run but when I write to pipe the second run again from start end come back whit fail.
      To be other way to make it in Windows?

      Thanks

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4

        Comment

        • Arepi
          New Member
          • Sep 2008
          • 62

          #5
          Thanks!

          I tried this before:

          Code:
          open(PIPE,"|perl -w Srcipt.pl"); 
           print PIPE "hello";
           close(PIPE);

          But this restart the destination script:I want write to the standard input of the destination script between it work.
          Last edited by Arepi; Sep 29 '08, 07:50 PM. Reason: bad tags

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            read the page I linked you to, all of it.

            Comment

            Working...