Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Re: Calling a shell script from perl

Expand Messages
  • merlyn@stonehenge.com
    ... Damien To call a shell script you can use the system function. This will Damien allow you to display the results in the browser. Use backticks if you
    Message 1 of 3 , Dec 30, 2005
    • 0 Attachment
      >>>>> "Damien" == Damien Carbery <daymobrew@...> writes:

      Damien> To call a shell script you can use the 'system' function. This will
      Damien> allow you to display the results in the browser. Use backticks if you
      Damien> want to capture and process the results, or if you want to discard them.

      Damien> For the log file reading, you could use 'tail' (or a module that does
      Damien> the same). You can use NPH (Non-Parsed Header) to continuously send
      Damien> data to the browser. A simpler alternative method would be code in the
      Damien> HTTP header telling the browser to call the script again after a
      Damien> specified period (5 secs in this example) i.e. META
      Damien> HTTP-EQUIV="Refresh" CONTENTS="5; URL=your_script.cgi"

      I have an example of doing that (launching a command, then
      watching its output) at:
      <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.