<?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 statement in the scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137560#M451722</link>
    <description>hi Aneesh,&lt;BR /&gt;&lt;BR /&gt;  Please help me. iam two errors.&lt;BR /&gt;&lt;BR /&gt;fi unexpected&lt;BR /&gt;then unexpected</description>
    <pubDate>Mon, 27 Oct 2008 10:00:05 GMT</pubDate>
    <dc:creator>Anjaneyulu</dc:creator>
    <dc:date>2008-10-27T10:00:05Z</dc:date>
    <item>
      <title>if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137553#M451715</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;  I am executing one program . But that is showing errors. Please is help me. &lt;BR /&gt;&lt;BR /&gt;My program is:&lt;BR /&gt;&lt;BR /&gt;echo $int1&lt;BR /&gt;echo $int2&lt;BR /&gt;if [ "$int1" -eq "$int2" ]&lt;BR /&gt;then&lt;BR /&gt;echo "command was successful"&lt;BR /&gt;elif&lt;BR /&gt;echo "command was unsuccessfull"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;I want in the execution time i want to assign the numbers for int1 and int2. Please tell me how to assign the numbers in execution time.&lt;BR /&gt;&lt;BR /&gt;thanx &amp;amp; Regards,&lt;BR /&gt;Anji.</description>
      <pubDate>Mon, 27 Oct 2008 07:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137553#M451715</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137554#M451716</link>
      <description>Hi Anji,&lt;BR /&gt;&lt;BR /&gt;Use &lt;BR /&gt;&lt;BR /&gt;read int1 and read int2 at the begining.&lt;BR /&gt;&lt;BR /&gt;Aneesh</description>
      <pubDate>Mon, 27 Oct 2008 08:13:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137554#M451716</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2008-10-27T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137555#M451717</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;to assign a value to a variable:&lt;BR /&gt;varname=varvalue&lt;BR /&gt;echo $varname&lt;BR /&gt;&lt;BR /&gt;to debug your script you can set "set -x" after "#!/usr/bin/ksh"&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Mon, 27 Oct 2008 08:16:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137555#M451717</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2008-10-27T08:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137556#M451718</link>
      <description>Hi again..&lt;BR /&gt;&lt;BR /&gt;If you want the script to prompt you for the variable at the time of execution then you may need to do &lt;BR /&gt;&lt;BR /&gt;echo "Reading the value of int1 :\c"&lt;BR /&gt;read int1&lt;BR /&gt;echo "Reading the value of int2 :\c"&lt;BR /&gt;read int2&lt;BR /&gt;if [ "$int1" = "$int2" ]&lt;BR /&gt;then&lt;BR /&gt;echo "command was successful"&lt;BR /&gt;else&lt;BR /&gt;echo "command was unsuccessfull"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;If you want assign a value in the script with out prompting then &lt;BR /&gt;&lt;BR /&gt;int1=xyz&lt;BR /&gt;int2=xyz&lt;BR /&gt;&lt;BR /&gt;Aneesh&lt;BR /&gt;&lt;BR /&gt;Aneesh</description>
      <pubDate>Mon, 27 Oct 2008 08:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137556#M451718</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2008-10-27T08:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137557#M451719</link>
      <description>Hi Anji,&lt;BR /&gt;&lt;BR /&gt;I can see you were not assigned points for previous thread,please assign point if our replies helped.&lt;BR /&gt;&lt;BR /&gt;Aneesh</description>
      <pubDate>Mon, 27 Oct 2008 08:49:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137557#M451719</guid>
      <dc:creator>Aneesh Mohan</dc:creator>
      <dc:date>2008-10-27T08:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137558#M451720</link>
      <description>Thanks to all</description>
      <pubDate>Mon, 27 Oct 2008 09:05:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137558#M451720</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T09:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137559#M451721</link>
      <description>hi but also iam getting error&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;read int1&lt;BR /&gt;read int2&lt;BR /&gt;&lt;BR /&gt;if [ "$int1" -eq "$int2" ]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo "command was successful"&lt;BR /&gt;elif&lt;BR /&gt;then&lt;BR /&gt;echo "command was unsuccessfull"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;   I tried like above . But Iam getting errors. please give me the instructions.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Anji.</description>
      <pubDate>Mon, 27 Oct 2008 09:37:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137559#M451721</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T09:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137560#M451722</link>
      <description>hi Aneesh,&lt;BR /&gt;&lt;BR /&gt;  Please help me. iam two errors.&lt;BR /&gt;&lt;BR /&gt;fi unexpected&lt;BR /&gt;then unexpected</description>
      <pubDate>Mon, 27 Oct 2008 10:00:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137560#M451722</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T10:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137561#M451723</link>
      <description>do not use&lt;BR /&gt;elif&lt;BR /&gt;use else:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;read int1&lt;BR /&gt;read int2&lt;BR /&gt;&lt;BR /&gt;if [[ "$int1" -eq "$int2" ]]&lt;BR /&gt;then&lt;BR /&gt;        echo "command was successful"&lt;BR /&gt;else&lt;BR /&gt;        echo "command was unsuccessfull"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Oct 2008 10:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137561#M451723</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2008-10-27T10:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137562#M451724</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;   I tried Iam getting wrong output:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;read int1&lt;BR /&gt;read int2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if [["$int1" -eq "$int2"]]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo "command was successful"&lt;BR /&gt;else&lt;BR /&gt;&lt;BR /&gt;echo "command was unsuccessfull"&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;OUTPUT:-&lt;BR /&gt;&lt;BR /&gt;$ sh test1&lt;BR /&gt;3&lt;BR /&gt;3&lt;BR /&gt;test1: [[3: not found&lt;BR /&gt;command was unsuccessfull&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Oct 2008 10:14:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137562#M451724</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T10:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137563#M451725</link>
      <description>sry there must be a space between [ and "$int1":&lt;BR /&gt;&lt;BR /&gt;if [[SPACE"$int1" -eq "$int2"SPACE]]&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Oct 2008 10:18:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137563#M451725</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2008-10-27T10:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137564#M451726</link>
      <description>Thank you Oviwan</description>
      <pubDate>Mon, 27 Oct 2008 10:21:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137564#M451726</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T10:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: if statement in the scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137565#M451727</link>
      <description>thanks to all</description>
      <pubDate>Mon, 27 Oct 2008 10:22:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-in-the-scripting/m-p/5137565#M451727</guid>
      <dc:creator>Anjaneyulu</dc:creator>
      <dc:date>2008-10-27T10:22:40Z</dc:date>
    </item>
  </channel>
</rss>

