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

Re: [PBML] unix shell and perl compatibility....

Expand Messages
  • Alan
    ... Standard disclaimer applies (still somewhat if not quite a lot of a Noob myself) perldoc -f system is a way to get something executed. But though I
    Message 1 of 3 , Jul 11 10:28 PM
    • 0 Attachment
      Kathryn Tate wrote:

      >I have a korn shell script I want to run as a subroutine inside a perl
      >script. Can I just do a qx() around the whole script?
      >
      Standard disclaimer applies (still somewhat if not quite a lot of a Noob
      myself)

      perldoc -f system

      is a way to get something executed. But though I occasionally use it, I
      certainly do not know if this is the most appropriate way to call up an
      script that has been chmod u+x (executable attribute)

      And I avoided a direct answer of your question as I don't think you can
      run something else as a sub routine (though I may be wrong) But I do
      know of system function and i think perhaps also there's an exec
      function. But I just now see that

      perldoc -f exec

      Reports early on that exec never returns. I'm not sure what that means,
      like doesn't return execution back to the Perl script that called the exec?

      Something that is executable, Perl can make it run, thus:

      system('name_of_x_script');

      --
      Alan.
    • Ateeq Ahmad
      Hello, i have done the system( ./script.sh ) many times and it works for me. i usually put the results of the shell(ksh,sh) that i want to run into a variable
      Message 2 of 3 , Jul 12 12:26 PM
      • 0 Attachment
        Hello,
        i have done the
        system("./script.sh") many times and it works for me.

        i usually put the results of the shell(ksh,sh) that i want to run into a
        variable for further processing e.g.

        $shell=system("./checkifDBisup.ksh");

        if $shell >0 {
        print "holy smokey doodles!!!\n";
        }

        -----Original Message-----
        From: Alan [mailto:acelists@...]
        Sent: Sunday, July 11, 2004 10:28 PM
        To: perl-beginner@yahoogroups.com
        Subject: Re: [PBML] unix shell and perl compatibility....


        Kathryn Tate wrote:

        >I have a korn shell script I want to run as a subroutine inside a perl
        >script. Can I just do a qx() around the whole script?
        >
        Standard disclaimer applies (still somewhat if not quite a lot of a Noob
        myself)

        perldoc -f system

        is a way to get something executed. But though I occasionally use it, I
        certainly do not know if this is the most appropriate way to call up an
        script that has been chmod u+x (executable attribute)

        And I avoided a direct answer of your question as I don't think you can
        run something else as a sub routine (though I may be wrong) But I do
        know of system function and i think perhaps also there's an exec
        function. But I just now see that

        perldoc -f exec

        Reports early on that exec never returns. I'm not sure what that means,
        like doesn't return execution back to the Perl script that called the exec?

        Something that is executable, Perl can make it run, thus:

        system('name_of_x_script');

        --
        Alan.





        Unsubscribing info is here:
        http://help.yahoo.com/help/us/groups/groups-32.html
        Yahoo! Groups Links
      Your message has been successfully submitted and would be delivered to recipients shortly.