<?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 issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277356#M640539</link>
    <description>&lt;BR /&gt;&amp;gt;&amp;gt;ls -lrt | awk '{if($7 == "1")if ($7==1) print $9}'&lt;BR /&gt;&lt;BR /&gt;Sorry the first if shouldnÂ´t be "Jan" as opposed to what you wrote which is "1"?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
    <pubDate>Tue, 22 Mar 2011 08:06:45 GMT</pubDate>
    <dc:creator>NDO</dc:creator>
    <dc:date>2011-03-22T08:06:45Z</dc:date>
    <item>
      <title>awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277354#M640537</link>
      <description>Hi All&lt;BR /&gt;&lt;BR /&gt;I´m not very familiar with scripting, Í am still learning.&lt;BR /&gt;Please can someone tell me what could be wrong with that command:&lt;BR /&gt;root@nrtrde1 # ls -lrt | awk '{if ($6 == "Jan") &amp;amp;&amp;amp; ($7 == "1")print $9}'&lt;BR /&gt;awk: syntax error near line 1&lt;BR /&gt;awk: illegal statement near line 1&lt;BR /&gt;&lt;BR /&gt;The idea is to list all files of 1st of january 2011. If I am able to do this I could write a script to transfer files from january 2011.&lt;BR /&gt;Your help is appreciated&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Tue, 22 Mar 2011 07:52:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277354#M640537</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-22T07:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277355#M640538</link>
      <description>ls -lrt | awk '{if($7 == "1")if ($7==1) print $9}'</description>
      <pubDate>Tue, 22 Mar 2011 08:01:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277355#M640538</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2011-03-22T08:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277356#M640539</link>
      <description>&lt;BR /&gt;&amp;gt;&amp;gt;ls -lrt | awk '{if($7 == "1")if ($7==1) print $9}'&lt;BR /&gt;&lt;BR /&gt;Sorry the first if shouldnÂ´t be "Jan" as opposed to what you wrote which is "1"?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Tue, 22 Mar 2011 08:06:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277356#M640539</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-22T08:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277357#M640540</link>
      <description>Sorry, 8(((&lt;BR /&gt; ls -lrt | awk '{if($6 == "Jan")if ($7==1) print $9}'</description>
      <pubDate>Tue, 22 Mar 2011 08:21:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277357#M640540</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2011-03-22T08:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277358#M640541</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;It does work now, but how if I want to exclude from that list all january 2010 files, because now is listing me all january 1st 2010 files, but what I want is January 2011.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Tue, 22 Mar 2011 11:00:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277358#M640541</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-22T11:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277359#M640542</link>
      <description>It is still not 'proper' awk.&lt;BR /&gt;&lt;BR /&gt;Proper awk IMHO is a series of conditions follows by code blocks.&lt;BR /&gt;&lt;BR /&gt;The example unconditionally goes into a codeblock and then starts a condition.&lt;BR /&gt;&lt;BR /&gt;Try this: $ ls -ltr | awk '($6=="Jan") &amp;amp;&amp;amp; ($7==1) {print $9}'&lt;BR /&gt;&lt;BR /&gt;Not for the real problem you do NOT want to use awk.&lt;BR /&gt;You want to use FIND.&lt;BR /&gt;&lt;BR /&gt;Check out the -ctime option, or the usage of 'reference files' through the -newer and -older options.  &lt;BR /&gt;Google and the MAN PAGES are your friend in this learning exercise.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2011 11:15:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277359#M640542</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-03-22T11:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277360#M640543</link>
      <description>So please define your request properly.&lt;BR /&gt;If you need some date filter, use find:&lt;BR /&gt;find /home/usersname -type f -mtime +5 -exec ls -ls {} \; &lt;BR /&gt;or something similar.&lt;BR /&gt;&lt;BR /&gt;Good luck !</description>
      <pubDate>Tue, 22 Mar 2011 11:47:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277360#M640543</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2011-03-22T11:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277361#M640544</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# touch -amt 201012312359.59 /tmp/ref1&lt;BR /&gt;# touch -amt 201101012359.59 /tmp/ref2&lt;BR /&gt;# find . -type f -newer /tmp/ref1 -a  ! -newer /tmp/ref2&lt;BR /&gt;&lt;BR /&gt;...will list the files *last_modified* on January 1, 2011&lt;BR /&gt;&lt;BR /&gt;See the manpages for 'touch(1)' and for 'find(1)'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2011 13:20:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277361#M640544</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-22T13:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277362#M640545</link>
      <description>&lt;!--!*#--&gt;&amp;gt;Hein: Proper awk IMHO is a series of conditions follow by code blocks.&lt;BR /&gt;&lt;BR /&gt;True but you can do C style programming:&lt;BR /&gt;... | awk '&lt;BR /&gt;{&lt;BR /&gt;if ($6 == "Jan" &amp;amp;&amp;amp; $7 == 1)&lt;BR /&gt;   print $9&lt;BR /&gt;}'</description>
      <pubDate>Wed, 23 Mar 2011 04:05:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277362#M640545</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-23T04:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277363#M640546</link>
      <description>Hi &lt;BR /&gt;Dennis:&lt;BR /&gt;&lt;BR /&gt;Your suggestion give me this:&lt;BR /&gt;-rw-r--r--   1 taprap   other      60414 Jan  1  2010 CDNAM01MOZ0105105&lt;BR /&gt;-rw-r--r--   1 taprap   other        123 Jan  1  2010 CDMWICPMOZ0103249&lt;BR /&gt;-rw-r--r--   1 taprap   other       1698 Jan  1  2010 CDISRCLMOZ0103103&lt;BR /&gt;-rw-r--r--   1 taprap   other        129 Jan  1 01:34 CDINDA9MOZ0101336&lt;BR /&gt;-rw-r--r--   1 taprap   other       3516 Jan  1 01:34 CDZMBCEMOZ0103029&lt;BR /&gt;-rw-r--r--   1 taprap   other        129 Jan  1 01:35 CDINDJBMOZ0102144&lt;BR /&gt;-rw-r--r--   1 taprap   other        647 Jan  1 01:35 CDINDA2MOZ0101581&lt;BR /&gt;-rw-r--r--   1 taprap   other        123 Jan  1 01:36 CDGRCPFMOZ0105837&lt;BR /&gt;-rw-r--r--   1 taprap   other        123 Jan  1 01:36 CDPRYHTMOZ0101023&lt;BR /&gt;&lt;BR /&gt;BUT I do not want the 2010 files, I just want the other files. How can I get rid of the Jan 1 2010 files?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Wed, 23 Mar 2011 05:50:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277363#M640546</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-23T05:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277364#M640547</link>
      <description>try this.&lt;BR /&gt;&lt;BR /&gt;... | awk '&lt;BR /&gt;{&lt;BR /&gt;if ($6 == "Jan" &amp;amp;&amp;amp; $7 == 1 &amp;amp;&amp;amp; $8 != 2010)&lt;BR /&gt;   print $9&lt;BR /&gt;}'</description>
      <pubDate>Wed, 23 Mar 2011 06:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277364#M640547</guid>
      <dc:creator>Shibin_2</dc:creator>
      <dc:date>2011-03-23T06:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277365#M640548</link>
      <description>Hi &lt;BR /&gt;Shibin!&lt;BR /&gt;&lt;BR /&gt;Your suggestion worked perfectely, I havwe modified slightly to list all January files of current year as this:&lt;BR /&gt;&lt;BR /&gt;ls -lrt | awk '{if ($6 == "Jan" &amp;amp;&amp;amp; $8 != 2010)print $0}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Wed, 23 Mar 2011 09:04:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277365#M640548</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-23T09:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: awk issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277366#M640549</link>
      <description>Thank you for your contributions. Already assign points&lt;BR /&gt;&lt;BR /&gt;F.R.</description>
      <pubDate>Tue, 29 Mar 2011 13:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-issue/m-p/5277366#M640549</guid>
      <dc:creator>NDO</dc:creator>
      <dc:date>2011-03-29T13:34:38Z</dc:date>
    </item>
  </channel>
</rss>

