<?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: Help need on perl scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589320#M827280</link>
    <description>This is not a valid use of the exec() function in Perl. Just like its C system call counterpart, exec() replaces the currently executing process and never returns so only the first exec() will ever be executed. You need to use the system() function instead which forks a child process to execute the command.</description>
    <pubDate>Mon, 25 Jul 2005 09:58:42 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-07-25T09:58:42Z</dc:date>
    <item>
      <title>Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589318#M827278</link>
      <description>Hello &lt;BR /&gt;&lt;BR /&gt;Can any tell me how to execute two unix commands by using perl "exec()" function.&lt;BR /&gt;&lt;BR /&gt;I want to execute below two commands in one shot.&lt;BR /&gt;1st Command is &lt;BR /&gt;DISPLAY=`/usr/bin/hostname`:10.0; export DISPLAY&lt;BR /&gt;&lt;BR /&gt;2nd command is&lt;BR /&gt;/usr/bin/X11/mwm -display :10.0&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Manoj</description>
      <pubDate>Mon, 25 Jul 2005 09:48:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589318#M827278</guid>
      <dc:creator>manoj_pu</dc:creator>
      <dc:date>2005-07-25T09:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589319#M827279</link>
      <description>In perl it would be very similiar-&lt;BR /&gt; &lt;BR /&gt;$display=`/usr/bin/hostname` . ":10.0";&lt;BR /&gt;system("DISPLAY='$display' ; /usr/bin/X11/mwm -display:10.0");&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 25 Jul 2005 09:57:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589319#M827279</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-07-25T09:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589320#M827280</link>
      <description>This is not a valid use of the exec() function in Perl. Just like its C system call counterpart, exec() replaces the currently executing process and never returns so only the first exec() will ever be executed. You need to use the system() function instead which forks a child process to execute the command.</description>
      <pubDate>Mon, 25 Jul 2005 09:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589320#M827280</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-07-25T09:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589321#M827281</link>
      <description>If you mean you want to run them one after the other but in one call to exec, then just chain them (like you have already chained DISPLAY= and export in the 1st "command"):&lt;BR /&gt;&lt;BR /&gt;exec 'DISPLAY=`/usr/bin/hostname`:10.0; export DISPLAY ; /usr/bin/X11/mwm -display :10.0'&lt;BR /&gt;&lt;BR /&gt;If you want to run them independantly in parallel, then there's no point.  All your 1st command does is export a variable.  Why do this if you're not going to use it, it'll disappear when you exit the exec anyhow.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2005 10:01:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589321#M827281</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-07-25T10:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589322#M827282</link>
      <description>Of course Rodney and Clay are correct in that you should use system() not exec()!</description>
      <pubDate>Mon, 25 Jul 2005 10:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589322#M827282</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-07-25T10:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589323#M827283</link>
      <description>Thanks Everyone for the quick help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Warm regards,&lt;BR /&gt;&lt;BR /&gt;Manoj</description>
      <pubDate>Mon, 25 Jul 2005 10:46:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589323#M827283</guid>
      <dc:creator>manoj_pu</dc:creator>
      <dc:date>2005-07-25T10:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help need on perl scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589324#M827284</link>
      <description>And perl promotes the %ENV hash&lt;BR /&gt;&lt;BR /&gt;use Sys::Hostname;&lt;BR /&gt;$ENV{DISPLAY}=hostname.":10.0";&lt;BR /&gt;system("/usr/bin/X11/mwm");&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 25 Jul 2005 11:09:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-need-on-perl-scripting/m-p/3589324#M827284</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-07-25T11:09:11Z</dc:date>
    </item>
  </channel>
</rss>

