<?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: kornshell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021814#M130613</link>
    <description>example: &lt;BR /&gt;if [[ $test2? = "abc" ]] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;should be:&lt;BR /&gt; &lt;BR /&gt;if [[ ${test2}c = "abc" ]] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;</description>
    <pubDate>Fri, 11 Jul 2003 19:05:07 GMT</pubDate>
    <dc:creator>Hai Nguyen_1</dc:creator>
    <dc:date>2003-07-11T19:05:07Z</dc:date>
    <item>
      <title>kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021812#M130611</link>
      <description>hello all! I'd like to ask all the ksh gurus. if its possible to assign an expression/condition (similar to a boolean) to a variable example. &lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;test1=[[ 0 &amp;lt; 1 ]] &lt;BR /&gt;and &lt;BR /&gt;test1 will be assigned the value of 0 since this expression evaluates to true. Can I use eval? I tried but to no avail.&lt;BR /&gt;&lt;BR /&gt;I also have another question:&lt;BR /&gt;I have a string test2="ab" &lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;if [[ $test2? = "abc" ]] ; then&lt;BR /&gt;echo "equal"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;which should print equal. I was trying this but it wouldn't matched. &lt;BR /&gt;&lt;BR /&gt;thanks so much guys!</description>
      <pubDate>Fri, 11 Jul 2003 18:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021812#M130611</guid>
      <dc:creator>mango_1</dc:creator>
      <dc:date>2003-07-11T18:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021813#M130612</link>
      <description>example: &lt;BR /&gt;if [[ $test2? = "abc" ]] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Should have double quotes around the var also and I believe single square brackets:&lt;BR /&gt;&lt;BR /&gt;example: &lt;BR /&gt;if [ "$test2" = "abc" ] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jul 2003 18:57:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021813#M130612</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-07-11T18:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021814#M130613</link>
      <description>example: &lt;BR /&gt;if [[ $test2? = "abc" ]] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;should be:&lt;BR /&gt; &lt;BR /&gt;if [[ ${test2}c = "abc" ]] ; then &lt;BR /&gt;echo "equal" &lt;BR /&gt;fi &lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jul 2003 19:05:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021814#M130613</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2003-07-11T19:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021815#M130614</link>
      <description>ksh doesn't not support boolean operators.&lt;BR /&gt;&lt;BR /&gt;versions newer then 88, ie newer then what is one hp-ux, has a builtin true command.  it does nothing and always has an exit code of 0. similiarly with false except it has an exit code of 1.&lt;BR /&gt;&lt;BR /&gt;the version on hp-ux usually implements these as an alias.  i've used the /usr/bin/true and false commands at times.  as an example.&lt;BR /&gt;&lt;BR /&gt;notDone=/usr/bin/true&lt;BR /&gt;a=a&lt;BR /&gt;# this will stay in the while loop until&lt;BR /&gt;# the letter b is input&lt;BR /&gt;#&lt;BR /&gt;while $notDone&lt;BR /&gt;do&lt;BR /&gt;  if [ $a = b] ;then&lt;BR /&gt;     notDone=/usr/bin/false  #drops out of while loop&lt;BR /&gt;  else&lt;BR /&gt;     print "type in a letter"&lt;BR /&gt;     read answer&lt;BR /&gt;  fi&lt;BR /&gt;done</description>
      <pubDate>Fri, 11 Jul 2003 19:27:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021815#M130614</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-07-11T19:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021816#M130615</link>
      <description>You can use the following:&lt;BR /&gt;&lt;BR /&gt;[[ 2 -gt 0 ]]&lt;BR /&gt;A=$?&lt;BR /&gt;&lt;BR /&gt;You can use double brackets to evaluate arithmetic operations:&lt;BR /&gt;&lt;BR /&gt;A=$(( 2&amp;gt;0 ))&lt;BR /&gt;&lt;BR /&gt;Remember that:&lt;BR /&gt;&lt;BR /&gt;a) arithmetic symbols as '&amp;gt;', '&amp;gt;=', '&amp;lt;', '&amp;lt;=' and bitwise operators (&amp;amp;,|,&amp;gt;&amp;gt;,&amp;lt;&amp;lt;) are only available using double brackets&lt;BR /&gt;&lt;BR /&gt;echo $(( 1 &amp;lt;&amp;lt; 4 )) # prints 16&lt;BR /&gt;&lt;BR /&gt;b) relational operators &amp;amp;&amp;amp; and || (instead of -a and -o used in test) are available using both double square brackets and double brackets&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jul 2003 08:30:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021816#M130615</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2003-07-14T08:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: kornshell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021817#M130616</link>
      <description>an important remark:&lt;BR /&gt;&lt;BR /&gt;when (( ... )) evaluates a conditional expression (for instance, (( 2&amp;gt;1 )) ) computes&lt;BR /&gt;&lt;BR /&gt;  1 when it is TRUE&lt;BR /&gt;  0 when it is FALSE&lt;BR /&gt;&lt;BR /&gt;BUT the return value is&lt;BR /&gt;&lt;BR /&gt;  0 when it is TRUE&lt;BR /&gt;  1 when it is FALSE&lt;BR /&gt;&lt;BR /&gt;Run the following examples:&lt;BR /&gt;&lt;BR /&gt;$ (( 2&amp;lt;3 )) &amp;amp;&amp;amp; echo true || echo false # prints true&lt;BR /&gt;$ echo $(( 2&amp;lt;3 )) # prints 1</description>
      <pubDate>Mon, 14 Jul 2003 08:38:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kornshell/m-p/3021817#M130616</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2003-07-14T08:38:48Z</dc:date>
    </item>
  </channel>
</rss>

