<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: running a shell script from perl in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960695#M101084</link>
    <description>Hi, &lt;BR /&gt;&lt;BR /&gt;Check this as well, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.tldp.org/LDP/abs/html/wrapper.html#BASHANDPERL" target="_blank"&gt;http://www.tldp.org/LDP/abs/html/wrapper.html#BASHANDPERL&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
    <pubDate>Fri, 17 Feb 2006 04:59:33 GMT</pubDate>
    <dc:creator>Arunvijai_4</dc:creator>
    <dc:date>2006-02-17T04:59:33Z</dc:date>
    <item>
      <title>running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960690#M101079</link>
      <description>I want to capture the output of a shell script in my perl program on HP UX 11.11.&lt;BR /&gt;I cannot use FTP.</description>
      <pubDate>Fri, 17 Feb 2006 04:43:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960690#M101079</guid>
      <dc:creator>rashmi R</dc:creator>
      <dc:date>2006-02-17T04:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960691#M101080</link>
      <description>Yes more ways.&lt;BR /&gt;&lt;BR /&gt;# cat test.sh&lt;BR /&gt;ls muthu # error&lt;BR /&gt;hostname # log&lt;BR /&gt;&lt;BR /&gt;# chmod u+x test.sh&lt;BR /&gt;&lt;BR /&gt;# cat test.pl&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;system("./test.sh 1&amp;gt;/tmp/out.log 2&amp;gt;/tmp/err.log");&lt;BR /&gt;&lt;BR /&gt;# perl test.pl&lt;BR /&gt;&lt;BR /&gt;That is it. Change the test.sh to your our script.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 04:52:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960691#M101080</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T04:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960692#M101081</link>
      <description>Hi Rashmi, &lt;BR /&gt;&lt;BR /&gt;You can "system" call that comes with perl. &lt;BR /&gt;Redirect STDOUT and STDERR wherever you want, just like, &lt;BR /&gt;system(" /tmp/tmp.sh 1&amp;gt;/tmp/out.log 2&amp;gt;/tmp/err.log");&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 17 Feb 2006 04:55:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960692#M101081</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-17T04:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960693#M101082</link>
      <description>Use qx[./test.sh 1&amp;gt;/tmp/test.log 2&amp;gt;&amp;amp;1]&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;`./test.sh 1&amp;gt;/tmp/test.log 2&amp;gt;&amp;amp;1`&lt;BR /&gt;&lt;BR /&gt;to complete your requirement.&lt;BR /&gt;&lt;BR /&gt;You can use open() in perl to get output from shell command or script execution as well.&lt;BR /&gt;&lt;BR /&gt;open FD, |./script.sh&lt;BR /&gt;&lt;BR /&gt;See this:&lt;BR /&gt;&lt;A href="http://www.sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/pod/perlfunc/open.html" target="_blank"&gt;http://www.sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/pod/perlfunc/open.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 04:56:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960693#M101082</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T04:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960694#M101083</link>
      <description>Example thread:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1002042" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1002042&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 04:59:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960694#M101083</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T04:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960695#M101084</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;Check this as well, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.tldp.org/LDP/abs/html/wrapper.html#BASHANDPERL" target="_blank"&gt;http://www.tldp.org/LDP/abs/html/wrapper.html#BASHANDPERL&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 17 Feb 2006 04:59:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960695#M101084</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-17T04:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960696#M101085</link>
      <description>One more discussion, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/f1c5b259748c9d8a/f30c5edf4e8f9970?lnk=st&amp;amp;q=using+shell+script+in+perl&amp;amp;rnum=2#f30c5edf4e8f9970" target="_blank"&gt;http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/f1c5b259748c9d8a/f30c5edf4e8f9970?lnk=st&amp;amp;q=using+shell+script+in+perl&amp;amp;rnum=2#f30c5edf4e8f9970&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Fri, 17 Feb 2006 05:09:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960696#M101085</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-17T05:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960697#M101086</link>
      <description>can u tell me how do i get... this &lt;BR /&gt;&lt;BR /&gt;open FD, |./script.sh &lt;BR /&gt;</description>
      <pubDate>Fri, 17 Feb 2006 05:26:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960697#M101086</guid>
      <dc:creator>rashmi R</dc:creator>
      <dc:date>2006-02-17T05:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960698#M101087</link>
      <description>Use like,&lt;BR /&gt;&lt;BR /&gt;# cat test.sh&lt;BR /&gt;ls muthu&lt;BR /&gt;hostname&lt;BR /&gt;&lt;BR /&gt;# perl -e ' open (FD,"|sh test.sh");'&lt;BR /&gt;muthu not found&lt;BR /&gt;# hostname&lt;BR /&gt;&lt;BR /&gt;PS: You have asked the method which I never used before :). See that link which I sent in prev. thread.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 05:39:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960698#M101087</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T05:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960699#M101088</link>
      <description>More better, use close (File descriptor) as like,&lt;BR /&gt;&lt;BR /&gt;perl -e ' open (FD,"|sh test.sh");close (FD);'&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 05:42:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960699#M101088</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T05:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960700#M101089</link>
      <description>well, to be more precise. i need the output of a shell script into a array / hash in my perl script &lt;BR /&gt;&lt;BR /&gt;my $sh = Shell-&amp;gt;new;&lt;BR /&gt;%kp = $sh-&amp;gt;(perl -e '\.test.sh') something like this ...</description>
      <pubDate>Fri, 17 Feb 2006 05:55:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960700#M101089</guid>
      <dc:creator>rashmi R</dc:creator>
      <dc:date>2006-02-17T05:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960701#M101090</link>
      <description>To store into an array then,&lt;BR /&gt;&lt;BR /&gt;# perl -e '@arr=`./test.sh 2&amp;gt;&amp;amp;1`;print $arr[0] . " " . $arr[1] . "\n";'&lt;BR /&gt;&lt;BR /&gt;2&amp;gt;&amp;amp;1 used to redirect Stand Error mode messages to standard output mode to store those informations into perl array.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Feb 2006 06:02:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960701#M101090</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T06:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960702#M101091</link>
      <description>thanks a lot muthu kumar and arun.</description>
      <pubDate>Fri, 17 Feb 2006 06:02:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960702#M101091</guid>
      <dc:creator>rashmi R</dc:creator>
      <dc:date>2006-02-17T06:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960703#M101092</link>
      <description>kwel. Use this &lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;  to assign points.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Fri, 17 Feb 2006 06:05:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960703#M101092</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-17T06:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: running a shell script from perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960704#M101093</link>
      <description>Hi Rashmi:&lt;BR /&gt;&lt;BR /&gt;If you want to run a program within a perl script and capture that program's output, don't use 'system()'.  It doesn't provide the program's output.&lt;BR /&gt;&lt;BR /&gt;Instead, a simple choice is to use a backtick syntax:&lt;BR /&gt;&lt;BR /&gt;$output = `/pathto/program`;&lt;BR /&gt;&lt;BR /&gt;You program will run and your perl script will dutifully wait until it's done, placing the program's output in the variable you choose.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 17 Feb 2006 06:07:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-a-shell-script-from-perl/m-p/4960704#M101093</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-17T06:07:10Z</dc:date>
    </item>
  </channel>
</rss>

