<?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: perl question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097832#M717394</link>
    <description>Both solutions work just fine. Thanks.</description>
    <pubDate>Mon, 20 Oct 2003 17:48:28 GMT</pubDate>
    <dc:creator>Ridzuan Zakaria</dc:creator>
    <dc:date>2003-10-20T17:48:28Z</dc:date>
    <item>
      <title>perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097826#M717388</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do write the below code in perl?&lt;BR /&gt;&lt;BR /&gt;LN="rwxrwxr-x   3 oracle     dba             96 Sep 16 16:48 datafile01.dbf";&lt;BR /&gt;&lt;BR /&gt;FLNM=`echo $LN | awk '{print($9)}'`&lt;BR /&gt;&lt;BR /&gt;I want to read the 9th column of the LN string.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;ridzuan</description>
      <pubDate>Mon, 20 Oct 2003 16:45:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097826#M717388</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2003-10-20T16:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097827#M717389</link>
      <description>This is one of those things that awk is better at doing but here is one Perl solution:&lt;BR /&gt;&lt;BR /&gt;echo "${LN}" | perl -e 'while (&amp;lt;&amp;gt;) {@a = split ' ',$_; print $a[8],"\n";}'</description>
      <pubDate>Mon, 20 Oct 2003 17:03:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097827#M717389</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-10-20T17:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097828#M717390</link>
      <description>There are of course many ways to solve this:&lt;BR /&gt;&lt;BR /&gt;With an array, after a split:&lt;BR /&gt;&lt;BR /&gt;perl -e '$_ = `ls -l x`; @words=split; print "$words[8]\n"'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Using a regular expression to remember in $1 the last series of non-spaces on the line:&lt;BR /&gt;&lt;BR /&gt;perl -e '$_ = `ls -l x`; if (/\s(\S+)$/) { print "$1\n" }'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Using the same split but labeling the returned array with variables"&lt;BR /&gt;&lt;BR /&gt;perl -e '$_ = `ls -l x`;($prot,$x,$group,$user,$size,$date1,$date1,$time,$name)=split; print "$name\n"'&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Oct 2003 17:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097828#M717390</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2003-10-20T17:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097829#M717391</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;In perl script:&lt;BR /&gt;$LN = "rwxrwxr-x 3 oracle dba 96 Sep 16 16:48 datafile01.dbf";&lt;BR /&gt;&lt;BR /&gt;$name = (split (" ", $LN))[8];&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Mon, 20 Oct 2003 17:22:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097829#M717391</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-10-20T17:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097830#M717392</link>
      <description>Don't count :) It's the last field:&lt;BR /&gt; &lt;BR /&gt;$name = (split/\s+/)[-1];&lt;BR /&gt; &lt;BR /&gt;why use external commands to get to file stuff? Because it's from a list? Good reason, otherwise use stat&lt;BR /&gt; &lt;BR /&gt;Enjoy, have Fun! H.Merijn</description>
      <pubDate>Mon, 20 Oct 2003 17:32:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097830#M717392</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-10-20T17:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097831#M717393</link>
      <description>By the way, if you have a working awk example, you can simply run it through a2p to translate it to Perl. It doesn't always produce pretty Perl but it does produce a workable solution that you can then modify.&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Oct 2003 17:37:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097831#M717393</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-10-20T17:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097832#M717394</link>
      <description>Both solutions work just fine. Thanks.</description>
      <pubDate>Mon, 20 Oct 2003 17:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3097832#M717394</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2003-10-20T17:48:28Z</dc:date>
    </item>
  </channel>
</rss>

