<?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: Calling Perl from Korn Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329060#M683441</link>
    <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;After changing to double quotes it worked fine.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for the help&lt;BR /&gt;Priya&lt;BR /&gt;:)</description>
    <pubDate>Sat, 27 Dec 2008 17:29:29 GMT</pubDate>
    <dc:creator>pgp_acc</dc:creator>
    <dc:date>2008-12-27T17:29:29Z</dc:date>
    <item>
      <title>Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329058#M683439</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I am new to korn scripting and perl,&lt;BR /&gt;My problem is that when i'm calling perl for replacing a number inside a korn script its not working...outside its working.&lt;BR /&gt;This is the code :&lt;BR /&gt;for subType in `grep ${File_subtype} ${eventFileSpec} | cut -d "," -f18 `&lt;BR /&gt;eventDuration=`echo ${subType} | cut -d "," -f18 | cut -d "\"" -f2`&lt;BR /&gt; tmp_duration=`expr $eventDuration / $val`&lt;BR /&gt;`perl -p -i -e 's/${eventDuration}/${tmp_duration}/' ${eventFileSpec}`&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Priya</description>
      <pubDate>Sat, 27 Dec 2008 16:58:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329058#M683439</guid>
      <dc:creator>pgp_acc</dc:creator>
      <dc:date>2008-12-27T16:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329059#M683440</link>
      <description>Hi Priya:&lt;BR /&gt;&lt;BR /&gt;The Perl script has no notion of the shell variables as you wrote this:&lt;BR /&gt;&lt;BR /&gt;# perl -p -i -e 's/${eventDuration}/${tmp_duration}/' ${eventFileSpec}&lt;BR /&gt;&lt;BR /&gt;While the shell expands ${eventFileSpec} the single quotes bounding the Perl script prevent the shell from expanding what lies between.  Changing the single quotes to double quotes is one way of passing shell variables here:&lt;BR /&gt;&lt;BR /&gt;# perl -p -i -e "s/${eventDuration}/${tmp_duration}/" ${eventFileSpec}&lt;BR /&gt;&lt;BR /&gt;A "better" way is to export the variables into your environment and use the Perl 'ENV' hash :&lt;BR /&gt;&lt;BR /&gt;# export eventDuration=whatever&lt;BR /&gt;# export tmp_duration=something&lt;BR /&gt;# perl -p -i -e 's/$ENV{eventDuration}/$ENV{tmp_duration}/' ${eventFileSpec}&lt;BR /&gt;&lt;BR /&gt;...notice that we can now return to the use of the (safer) single quotes.&lt;BR /&gt;&lt;BR /&gt;You might have more rapidly discovered the problem here had you added the warning pragma to your Perl script by adding the '-w' flag.&lt;BR /&gt;&lt;BR /&gt;As for the remainder of your Shell code, you need a 'do' as in"&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;for subType in ...&lt;BR /&gt;do&lt;BR /&gt;...&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sat, 27 Dec 2008 17:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329059#M683440</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-12-27T17:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329060#M683441</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;After changing to double quotes it worked fine.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for the help&lt;BR /&gt;Priya&lt;BR /&gt;:)</description>
      <pubDate>Sat, 27 Dec 2008 17:29:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329060#M683441</guid>
      <dc:creator>pgp_acc</dc:creator>
      <dc:date>2008-12-27T17:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329061#M683442</link>
      <description>Hi (again) Priya:&lt;BR /&gt;&lt;BR /&gt;Well good, but assigning zero points is hardly correct or a good way to insure future help from folks.  Please read:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 27 Dec 2008 17:38:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329061#M683442</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-12-27T17:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329062#M683443</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Sorry...I thgt i assigned points...&lt;BR /&gt;&lt;BR /&gt;Priya</description>
      <pubDate>Sat, 27 Dec 2008 17:41:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329062#M683443</guid>
      <dc:creator>pgp_acc</dc:creator>
      <dc:date>2008-12-27T17:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Perl from Korn Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329063#M683444</link>
      <description>Hi (again) Priya:&lt;BR /&gt;&lt;BR /&gt;Thanks, and welcome to the HP-UX ITRC Forums!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 27 Dec 2008 17:44:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calling-perl-from-korn-script/m-p/4329063#M683444</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-12-27T17:44:01Z</dc:date>
    </item>
  </channel>
</rss>

