<?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: My awking buddies. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939853#M102707</link>
    <description>Ok Jim, if I use nawk on the Solaris system with your help I get the results,  as always guys I knew you would be it to death and come up with the correct answer...</description>
    <pubDate>Thu, 10 Nov 2005 16:31:36 GMT</pubDate>
    <dc:creator>Belinda Dermody</dc:creator>
    <dc:date>2005-11-10T16:31:36Z</dc:date>
    <item>
      <title>My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939841#M102695</link>
      <description>I am trying to use the current MM DD variable with a awk command within a script, extracting current days sudo usage, each entry is two lines.&lt;BR /&gt;&lt;BR /&gt;I get the following to work but the date is hard coded.&lt;BR /&gt;awk '/Nov 10/ {print $0; for (i=1;i&amp;lt;2;i++) {getline;print $0; } }' /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;I want to set the date for each run with the CDATE=`date "+%b %d"` and beable to use the $CDATE instead of Nov 10 as above.</description>
      <pubDate>Thu, 10 Nov 2005 14:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939841#M102695</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T14:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939842#M102696</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;awk '/'"$CDATE"'/ {print $0; for (i=1;i&amp;lt;2;i++) {getline;print $0; } }' /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 10 Nov 2005 14:44:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939842#M102696</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-11-10T14:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939843#M102697</link>
      <description>Here is a script that I wrote a few years ago. I believe it is doing what you want. &lt;BR /&gt;Modify for your use and preferences.&lt;BR /&gt;&lt;BR /&gt;Note; Later versions of the sudo.log have a different layout of the file. The result is that this script will pull values that are no longer in this position.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Nov 2005 14:55:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939843#M102697</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-11-10T14:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939844#M102698</link>
      <description>Geoff I have already tried that, the preceeding ' nullifies all the special characters so the $ is not translated..</description>
      <pubDate>Thu, 10 Nov 2005 15:10:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939844#M102698</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939845#M102699</link>
      <description>James:&lt;BR /&gt;&lt;BR /&gt;One way:&lt;BR /&gt;&lt;BR /&gt;# CDATE1=`date +%b`&lt;BR /&gt;# CDATE2=`date +%d`&lt;BR /&gt;# awk $1~CDATE1 &amp;amp;&amp;amp; $2~CDATE2 {print $0;for (i=1;i&amp;lt;2;i++) {getline;print $0;}}' CDATE1=${CDATE1} CDATE2=${CDATE2} /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;You will need to change $1 and $2 to match the actual field numbers in you record.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Nov 2005 15:16:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939845#M102699</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-10T15:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939846#M102700</link>
      <description>Jim, good to hear from you again, I get the good ole bail out in awk using your suggestion.  See the attached word doc...&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Nov 2005 15:39:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939846#M102700</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T15:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939847#M102701</link>
      <description>Hi (again) James:&lt;BR /&gt;&lt;BR /&gt;Sorry, looks like I transposed a "'".  Try:&lt;BR /&gt;&lt;BR /&gt;# awk '$1~CDATE1 &amp;amp;&amp;amp; $2~CDATE2 {print $0; for (i=1;i&amp;lt;2;i++) {getline;print $0;}}' CDATE1=${CDATE1} CDATE2=${CDATE2} /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Nov 2005 15:43:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939847#M102701</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-10T15:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939848#M102702</link>
      <description>How about...&lt;BR /&gt;&lt;BR /&gt;# CDATE=`date "+%b %d"`&lt;BR /&gt;&lt;BR /&gt;# awk '$0 ~ cdt {print $0;for(i=1;i&amp;lt;2;i++) {getline;print $0}}' cdt="$CDATE" /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Thu, 10 Nov 2005 15:47:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939848#M102702</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-10T15:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939849#M102703</link>
      <description>Still getting bailouts</description>
      <pubDate>Thu, 10 Nov 2005 16:03:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939849#M102703</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T16:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939850#M102704</link>
      <description>Hi James:&lt;BR /&gt;&lt;BR /&gt;My second post seems to work in my hands if I cut-and-paste from this site.  Are you still getting syntax errors?  No points if "yes" and/or at your discretion.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Nov 2005 16:16:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939850#M102704</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-10T16:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939851#M102705</link>
      <description>What about adding the carrot ^:&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;awk '/^'"$CDATE"'/ {print $0; for (i=1;i&amp;lt;2;i++) {getline;print $0; } }' /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 10 Nov 2005 16:23:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939851#M102705</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-11-10T16:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939852#M102706</link>
      <description>Jim, you are right, I maintain HP and Sun systems, it works ok from the command line on the HP system but I get bail out on the Sun system runnning Solaris 10.  My HP sudo logs are one liners so I have no problem with those sysems, it is the new Sun systems that were dropped in my lap..</description>
      <pubDate>Thu, 10 Nov 2005 16:24:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939852#M102706</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T16:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939853#M102707</link>
      <description>Ok Jim, if I use nawk on the Solaris system with your help I get the results,  as always guys I knew you would be it to death and come up with the correct answer...</description>
      <pubDate>Thu, 10 Nov 2005 16:31:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939853#M102707</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T16:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939854#M102708</link>
      <description>Hi James:&lt;BR /&gt;&lt;BR /&gt;OK.  There is another syntax to pass external variable.  It uses '-v'.  Try this:&lt;BR /&gt;&lt;BR /&gt;# awk -v CDATE1=${CDATE1} -v CDATE2=${CDATE2} '$1~CDATE1 &amp;amp;&amp;amp; $2~CDATE2 {print $0; for (i=1;i&amp;lt;2;i++) {getline;print $0;}}' /var/log/sudo.log&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Nov 2005 16:32:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939854#M102708</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-11-10T16:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: My awking buddies.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939855#M102709</link>
      <description>Boy, I just read my closure, need a editor to verify what I wrote.  Meant to say with all your help beating it to death we came up with the correct answer.  I am not trying anything else, I have a stress headache already and if it works don't change it...</description>
      <pubDate>Thu, 10 Nov 2005 16:38:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-awking-buddies/m-p/4939855#M102709</guid>
      <dc:creator>Belinda Dermody</dc:creator>
      <dc:date>2005-11-10T16:38:50Z</dc:date>
    </item>
  </channel>
</rss>

