<?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: Compare two variables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493267#M680552</link>
    <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;This works (and tested with &lt;STATEMENT&gt;|xd):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOW=`date +%b%e`&lt;BR /&gt;        HR=22&lt;BR /&gt;        SP=$NOW" "$HR&lt;BR /&gt;        echo $SP&lt;BR /&gt;&lt;BR /&gt;        CHECK=`ll -tr /tmp/myfile*| awk ' { print $6,$7,substr($8,1,2)}'|tail -n&lt;BR /&gt; 1`&lt;BR /&gt;        echo $CHECK&lt;BR /&gt;&lt;BR /&gt;        if [ "$SP" = "$CHECK" ]&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;/STATEMENT&gt;</description>
    <pubDate>Tue, 08 Sep 2009 09:00:09 GMT</pubDate>
    <dc:creator>Graham Van der vaart_1</dc:creator>
    <dc:date>2009-09-08T09:00:09Z</dc:date>
    <item>
      <title>Compare two variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493264#M680549</link>
      <description>Hi&lt;BR /&gt;I have a shell script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOW=`date +%b' '%e' '`&lt;BR /&gt;HR=22&lt;BR /&gt;SP=$NOW$HR&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CHECK=`ll -tr /tmp/myfile*| awk ' { print $6,$7,substr&lt;BR /&gt;($8,1,2)}'|tail -n 1`&lt;BR /&gt;        &lt;BR /&gt;&lt;BR /&gt;if [ "$SP" = "$CHECK" ]&lt;BR /&gt;then&lt;BR /&gt;{&lt;BR /&gt;    echo "File did arrive at 22h00 today"&lt;BR /&gt;     exit 0&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt; echo "File did not arrive at 22h00 today"&lt;BR /&gt; exit 0&lt;BR /&gt;}&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;I want to schedule this script to run at 22h05 to check if a new version of a file (myfile*) has arrived at 22h00.&lt;BR /&gt;No matter how I script the expression in the if statement it doesn't behave as expected.&lt;BR /&gt;What am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Graham</description>
      <pubDate>Tue, 08 Sep 2009 05:46:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493264#M680549</guid>
      <dc:creator>Graham Van der vaart_1</dc:creator>
      <dc:date>2009-09-08T05:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493265#M680550</link>
      <description>Your awk expression produces an output like "Sep 8 10", with a single space between each element.&lt;BR /&gt;&lt;BR /&gt;However, the date command produces two spaces between "Sep" and "8". The "%e" format code for the "date" command always output exactly two characters.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Tue, 08 Sep 2009 06:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493265#M680550</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2009-09-08T06:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493266#M680551</link>
      <description>&amp;gt;NOW=`date +%b' '%e' '`&lt;BR /&gt;Try this:&lt;BR /&gt;NOW=`date +%b%e`</description>
      <pubDate>Tue, 08 Sep 2009 06:44:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493266#M680551</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-09-08T06:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two variables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493267#M680552</link>
      <description>Thanks,&lt;BR /&gt;&lt;BR /&gt;This works (and tested with &lt;STATEMENT&gt;|xd):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOW=`date +%b%e`&lt;BR /&gt;        HR=22&lt;BR /&gt;        SP=$NOW" "$HR&lt;BR /&gt;        echo $SP&lt;BR /&gt;&lt;BR /&gt;        CHECK=`ll -tr /tmp/myfile*| awk ' { print $6,$7,substr($8,1,2)}'|tail -n&lt;BR /&gt; 1`&lt;BR /&gt;        echo $CHECK&lt;BR /&gt;&lt;BR /&gt;        if [ "$SP" = "$CHECK" ]&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;/STATEMENT&gt;</description>
      <pubDate>Tue, 08 Sep 2009 09:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-two-variables/m-p/4493267#M680552</guid>
      <dc:creator>Graham Van der vaart_1</dc:creator>
      <dc:date>2009-09-08T09:00:09Z</dc:date>
    </item>
  </channel>
</rss>

