<?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: IF condition in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830397#M778867</link>
    <description>See man test:&lt;BR /&gt;&lt;BR /&gt; -o  Binary OR operator (-a has higher precedence than -o).&lt;BR /&gt;&lt;BR /&gt;-s file   True if file exists and has a size greater than zero.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
    <pubDate>Tue, 25 Jul 2006 13:13:44 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2006-07-25T13:13:44Z</dc:date>
    <item>
      <title>IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830395#M778865</link>
      <description>Can someone help me , what the following IF condition is checking , i'm confused because it checks same file from same location. also wat is the significance of -o -s options.&lt;BR /&gt;&lt;BR /&gt;if [ ! -f "$SOURCE/inven_file_cu.dat" -o -s "$SOURCE/inven_file_cu.dat" ]; then&lt;BR /&gt;  echo 'Process the inventory data'&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 25 Jul 2006 13:08:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830395#M778865</guid>
      <dc:creator>intp</dc:creator>
      <dc:date>2006-07-25T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830396#M778866</link>
      <description>man test will give you the answer quickly &lt;BR /&gt;&lt;BR /&gt;-f file exists and is regular&lt;BR /&gt;-o or &lt;BR /&gt;-s file exists and is greater than zero bytes</description>
      <pubDate>Tue, 25 Jul 2006 13:13:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830396#M778866</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2006-07-25T13:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830397#M778867</link>
      <description>See man test:&lt;BR /&gt;&lt;BR /&gt; -o  Binary OR operator (-a has higher precedence than -o).&lt;BR /&gt;&lt;BR /&gt;-s file   True if file exists and has a size greater than zero.&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jul 2006 13:13:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830397#M778867</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-07-25T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830398#M778868</link>
      <description>! -f tests if file doesn't exist and is not a regular file&lt;BR /&gt;-o OR&lt;BR /&gt;-s tests if the size of the file is greater than zero&lt;BR /&gt;&lt;BR /&gt;the  condition is contradictory and would never evaluate to true unless the negation sign ! is removed.</description>
      <pubDate>Tue, 25 Jul 2006 13:18:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830398#M778868</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-07-25T13:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830399#M778869</link>
      <description>"The condition is contradictory and would never evaluate to true unless the negation sign ! is removed."&lt;BR /&gt;&lt;BR /&gt;Actually, it tests true if the file doesn't exist, or if the file exists and has size. If it were an "and" expression instead of an "or", then it would never evaluate to true...</description>
      <pubDate>Tue, 25 Jul 2006 13:34:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830399#M778869</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-07-25T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830400#M778870</link>
      <description>-o means "OR": if at least one of the subconditions separated by "-o" is true, the entire condition is true&lt;BR /&gt;&lt;BR /&gt;-f is true if a file exists _and_ it is a regular file&lt;BR /&gt;&lt;BR /&gt;-s is true if a file exists _and_ its size is greater than zero&lt;BR /&gt;&lt;BR /&gt;So, the condition would mean:&lt;BR /&gt;"If $SOURCE/inven_file_cu.dat is something other than a regular file, or if it is a file with greater-than-zero length, then process the inventory data".&lt;BR /&gt;&lt;BR /&gt;"Something other than a regular file" would include a directory, a named pipe (created using "mknod &lt;NAME&gt; p") or a device. If the target of the test is a symbolic link, the condition is evaluated according to what is on the other end of the link.&lt;BR /&gt;&lt;BR /&gt;I have a feeling the creator of this condition might not have been aware of all the possible "not a regular file" choices... but without knowing more about the script it is impossible to be sure.&lt;BR /&gt;&lt;/NAME&gt;</description>
      <pubDate>Tue, 25 Jul 2006 13:40:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830400#M778870</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2006-07-25T13:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830401#M778871</link>
      <description>Correct Jonathan...got confused by the test condition. If the primaries were connected by AND (-a) then the expression would never be true.&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Tue, 25 Jul 2006 13:47:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830401#M778871</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-07-25T13:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: IF condition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830402#M778872</link>
      <description>Thanks All.</description>
      <pubDate>Wed, 26 Jul 2006 07:27:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-condition/m-p/3830402#M778872</guid>
      <dc:creator>intp</dc:creator>
      <dc:date>2006-07-26T07:27:55Z</dc:date>
    </item>
  </channel>
</rss>

