<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Awk on Companionway</title>
    <link>http://localhost:1313/tags/awk/</link>
    <description>Recent content in Awk on Companionway</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 02 May 2015 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://localhost:1313/tags/awk/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to print the remainder of a line using awk</title>
      <link>http://localhost:1313/post/2015-05-02-post1/</link>
      <pubDate>Sat, 02 May 2015 00:00:00 +0000</pubDate>
      <guid>http://localhost:1313/post/2015-05-02-post1/</guid>
      <description>&lt;p&gt;#How to print remainder of line using awk&lt;/p&gt;&#xA;&lt;h2 id=&#34;eliminate-the-first-x-columns&#34;&gt;eliminate the first X columns&amp;hellip;&lt;/h2&gt;&#xA;&lt;p&gt;Here is your challenge you have a list of cronjobs and you&#xA;want to just execute the scheduled backup command with its&#xA;arguments for a test run.&lt;/p&gt;&#xA;&lt;p&gt;Using one command line, how would you do it?&lt;/p&gt;&#xA;&lt;p&gt;Here is a sample root cronjob and I want to run the&#xA;first entry with its arguments as a test run:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# m h  dom mon dow   command&#xA; 0 16  *   *   * /data/share/home/geoffm/dev/utils/bak-it.sh -i /usr/local/etc/include.lst -e /usr/local/etc/exclude.lst -t /data/bak/`hostname` -s 7 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;  5 0  *   *   * /data/share/motion/arch-files.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;*/15 *  *   *   * /data/share/home/geoffm/grab-pic.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;####### below are WIP or OLD ########&#xA;# 16 6  *   *   * /usr/sbin/lynis -c --auditor &amp;#34;automated&amp;#34; --cronjob --quiet &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;#*/5 *  *   *   * /usr/local/bin/watch-proc.sh -f /usr/local/etc/watch-proc.conf -n geoffm@localhost &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;#*/5 * * * * /data/share/home/geoffm/ping-pong.sh &amp;#34;ping -c2 192.168.1.55&amp;#34; &amp;#34;ssh 192.168.1.1 reboot&amp;#34; &amp;gt;/dev/null&#xA;#  7 * * * /usr/local/sbin/postfix_report.sh &amp;amp;&amp;gt; /dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>How to print the remainder of a line using awk</title>
      <link>http://localhost:1313/search/post/2015-05-02-post1/</link>
      <pubDate>Sat, 02 May 2015 00:00:00 +0000</pubDate>
      <guid>http://localhost:1313/search/post/2015-05-02-post1/</guid>
      <description>&lt;p&gt;#How to print remainder of line using awk&lt;/p&gt;&#xA;&lt;h2 id=&#34;eliminate-the-first-x-columns&#34;&gt;eliminate the first X columns&amp;hellip;&lt;/h2&gt;&#xA;&lt;p&gt;Here is your challenge you have a list of cronjobs and you&#xA;want to just execute the scheduled backup command with its&#xA;arguments for a test run.&lt;/p&gt;&#xA;&lt;p&gt;Using one command line, how would you do it?&lt;/p&gt;&#xA;&lt;p&gt;Here is a sample root cronjob and I want to run the&#xA;first entry with its arguments as a test run:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# m h  dom mon dow   command&#xA; 0 16  *   *   * /data/share/home/geoffm/dev/utils/bak-it.sh -i /usr/local/etc/include.lst -e /usr/local/etc/exclude.lst -t /data/bak/`hostname` -s 7 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;  5 0  *   *   * /data/share/motion/arch-files.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;*/15 *  *   *   * /data/share/home/geoffm/grab-pic.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;####### below are WIP or OLD ########&#xA;# 16 6  *   *   * /usr/sbin/lynis -c --auditor &amp;#34;automated&amp;#34; --cronjob --quiet &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;#*/5 *  *   *   * /usr/local/bin/watch-proc.sh -f /usr/local/etc/watch-proc.conf -n geoffm@localhost &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;#*/5 * * * * /data/share/home/geoffm/ping-pong.sh &amp;#34;ping -c2 192.168.1.55&amp;#34; &amp;#34;ssh 192.168.1.1 reboot&amp;#34; &amp;gt;/dev/null&#xA;#  7 * * * /usr/local/sbin/postfix_report.sh &amp;amp;&amp;gt; /dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Centering a string</title>
      <link>http://localhost:1313/post/2015-04-02-post1/</link>
      <pubDate>Thu, 02 Apr 2015 00:00:00 +0000</pubDate>
      <guid>http://localhost:1313/post/2015-04-02-post1/</guid>
      <description>&lt;h1 id=&#34;center-a-string-using-awk&#34;&gt;Center a string using awk&lt;/h1&gt;&#xA;&lt;h2 id=&#34;awk--everyones-favorite---right&#34;&gt;awk = everyone&amp;rsquo;s favorite - right?&lt;/h2&gt;&#xA;&lt;p&gt;People who know me also know that I prefer simple&#xA;universally available tools to get a job done. Awk is&#xA;probably one of my favorites because it does pretty&#xA;much anything I need for quick and simple jobs. It is&#xA;far more powerful than most people realize including&#xA;associative arrays and it will do anything grep and sed&lt;br&gt;&#xA;can do.&lt;/p&gt;&#xA;&lt;p&gt;Recently I had the need to center a string of text. This&#xA;is a easy problem that pretty much any freshman programmer&#xA;can accomplish in a heartbeat but I decided to do it with&#xA;awk. This sample gives you a chance to explore rudimentary&#xA;features of awk.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Centering a string</title>
      <link>http://localhost:1313/search/post/2015-04-02-post1/</link>
      <pubDate>Thu, 02 Apr 2015 00:00:00 +0000</pubDate>
      <guid>http://localhost:1313/search/post/2015-04-02-post1/</guid>
      <description>&lt;h1 id=&#34;center-a-string-using-awk&#34;&gt;Center a string using awk&lt;/h1&gt;&#xA;&lt;h2 id=&#34;awk--everyones-favorite---right&#34;&gt;awk = everyone&amp;rsquo;s favorite - right?&lt;/h2&gt;&#xA;&lt;p&gt;People who know me also know that I prefer simple&#xA;universally available tools to get a job done. Awk is&#xA;probably one of my favorites because it does pretty&#xA;much anything I need for quick and simple jobs. It is&#xA;far more powerful than most people realize including&#xA;associative arrays and it will do anything grep and sed&lt;br&gt;&#xA;can do.&lt;/p&gt;&#xA;&lt;p&gt;Recently I had the need to center a string of text. This&#xA;is a easy problem that pretty much any freshman programmer&#xA;can accomplish in a heartbeat but I decided to do it with&#xA;awk. This sample gives you a chance to explore rudimentary&#xA;features of awk.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
