<?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: doubt on while loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955051#M638962</link>
    <description>&lt;P&gt;The expression with double square brackets is a conditional expression that is parsed by the shell that is executing the script, so you should identify the shell that is used to run the script. Is it sh, ksh or something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if the script is run using /sbin/sh or /usr/bin/sh in HP-UX, the sh-posix(1) man page lists all the possible conditions for a double-square-bracket conditional expression in a chapter titled &lt;EM&gt;Conditional Expressions&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, &lt;FONT face="courier new,courier"&gt;-a &amp;lt;filename&amp;gt;&lt;/FONT&gt; means "the condition is true if &amp;lt;filename&amp;gt; exists". The test completely ignores the type of &amp;lt;filename&amp;gt;: it might actually be a directory, a symbolic link, a named pipe, or something else.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The loop will run as long as /tmp/audit.lock exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might have been confused because in a single-square-bracket expression, the -a has a completely different meaning: it appears as &lt;FONT face="courier new,courier"&gt;&amp;lt;condition&amp;gt; -a &amp;lt;condition&amp;gt;&lt;/FONT&gt; and means that the expression is true only if both conditions are true.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2013 06:34:40 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2013-02-05T06:34:40Z</dc:date>
    <item>
      <title>doubt on while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955003#M638961</link>
      <description>&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a script i saw a while loop&amp;nbsp; having below condition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while [[ -a $LOCK_FILE ]]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do { ===== done }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you please tell me what this while condition will do. This&amp;nbsp; LOCK_FILE is decalred as /tmp/audit.lock&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2013 05:35:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955003#M638961</guid>
      <dc:creator>laiju.c.babu</dc:creator>
      <dc:date>2013-02-05T05:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: doubt on while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955051#M638962</link>
      <description>&lt;P&gt;The expression with double square brackets is a conditional expression that is parsed by the shell that is executing the script, so you should identify the shell that is used to run the script. Is it sh, ksh or something else?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if the script is run using /sbin/sh or /usr/bin/sh in HP-UX, the sh-posix(1) man page lists all the possible conditions for a double-square-bracket conditional expression in a chapter titled &lt;EM&gt;Conditional Expressions&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, &lt;FONT face="courier new,courier"&gt;-a &amp;lt;filename&amp;gt;&lt;/FONT&gt; means "the condition is true if &amp;lt;filename&amp;gt; exists". The test completely ignores the type of &amp;lt;filename&amp;gt;: it might actually be a directory, a symbolic link, a named pipe, or something else.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The loop will run as long as /tmp/audit.lock exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might have been confused because in a single-square-bracket expression, the -a has a completely different meaning: it appears as &lt;FONT face="courier new,courier"&gt;&amp;lt;condition&amp;gt; -a &amp;lt;condition&amp;gt;&lt;/FONT&gt; and means that the expression is true only if both conditions are true.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2013 06:34:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955051#M638962</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2013-02-05T06:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: question on conditional expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955189#M638963</link>
      <description>&lt;P&gt;Be careful if replacing it with -e, that's only for sh, not ksh.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2013 08:33:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955189#M638963</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-02-05T08:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: doubt on while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955193#M638964</link>
      <description>&lt;P&gt;Hi MK,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply, the shell on which this script is executing is /usr/bin/ksh.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2013 08:35:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/doubt-on-while-loop/m-p/5955193#M638964</guid>
      <dc:creator>laiju.c.babu</dc:creator>
      <dc:date>2013-02-05T08:35:20Z</dc:date>
    </item>
  </channel>
</rss>

