<?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: awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050318#M434664</link>
    <description>Use another awk:&lt;BR /&gt;&lt;BR /&gt;echo prof.u18 | awk -F "." '{print$2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 31 May 2007 14:08:46 GMT</pubDate>
    <dc:creator>Ivan Krastev</dc:creator>
    <dc:date>2007-05-31T14:08:46Z</dc:date>
    <item>
      <title>awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050317#M434663</link>
      <description>Hello guys.&lt;BR /&gt;&lt;BR /&gt;Please I need a help with the awk command.&lt;BR /&gt;&lt;BR /&gt;When I run the command:&lt;BR /&gt;&lt;BR /&gt;:#/ls -al prof* | head -1 |awk '{print $9}'&lt;BR /&gt;&lt;BR /&gt;I have the following:&lt;BR /&gt;prof.u18&lt;BR /&gt;&lt;BR /&gt;How can I get only "u18" in the same line command?&lt;BR /&gt;&lt;BR /&gt;Please, could someone give me a help?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;clefeitosa&lt;BR /&gt;</description>
      <pubDate>Thu, 31 May 2007 14:01:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050317#M434663</guid>
      <dc:creator>cfeitosa</dc:creator>
      <dc:date>2007-05-31T14:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050318#M434664</link>
      <description>Use another awk:&lt;BR /&gt;&lt;BR /&gt;echo prof.u18 | awk -F "." '{print$2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 May 2007 14:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050318#M434664</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2007-05-31T14:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050319#M434665</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# ls -al prof* | head -1 | awk '{split($9,a,".");print a[2]}'&lt;BR /&gt;&lt;BR /&gt;...although you can eliminate the 'head' process too:&lt;BR /&gt;&lt;BR /&gt;# ls -al prof* | awk '{NR==1 &amp;amp;&amp;amp; split($9,a,".");print a[2]}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 31 May 2007 14:11:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050319#M434665</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-05-31T14:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050320#M434666</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...and since it's the last field of the 'ls' output you want:&lt;BR /&gt;&lt;BR /&gt;# # ls -al prof* | awk '{NR==1 &amp;amp;&amp;amp; split($NF,a,".");print a[2]}'&lt;BR /&gt;&lt;BR /&gt;...that is, why count nine fields when $NF points to the last...&lt;BR /&gt;&lt;BR /&gt;Thus is you "slip" and do 'ls -als' and there are ten fields, everything still works!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 31 May 2007 14:16:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050320#M434666</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-05-31T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050321#M434667</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for all answer.&lt;BR /&gt;Was very useful&lt;BR /&gt;&lt;BR /&gt;I'm using the following:&lt;BR /&gt;ls -al prof* | head -1 | awk -F "." '{print $2}'&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;BR /&gt;</description>
      <pubDate>Thu, 31 May 2007 14:26:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050321#M434667</guid>
      <dc:creator>cfeitosa</dc:creator>
      <dc:date>2007-05-31T14:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050322#M434668</link>
      <description># ls -al prof* | awk -F. 'NR==1 {print $NF}'</description>
      <pubDate>Thu, 31 May 2007 14:27:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050322#M434668</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-05-31T14:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050323#M434669</link>
      <description>You of course can change your ls(1) to:&lt;BR /&gt;$ ls -a prof*&lt;BR /&gt;&lt;BR /&gt;Then you only need to process the one field and don't have to count.  :-)</description>
      <pubDate>Thu, 31 May 2007 22:38:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/5050323#M434669</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-31T22:38:58Z</dc:date>
    </item>
  </channel>
</rss>

