<?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: Testing in  Bourne shell vs POSIX shell in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928113#M104928</link>
    <description>Hi renarios,&lt;BR /&gt;the problem is not related to teh shell, but to Oracle. You disable the header putting head off but not the new page. Instead of head off use pages 0 and SQL will retrun the status withou any control char:&lt;BR /&gt;&lt;BR /&gt;Your code:&lt;BR /&gt;09:58 GPOP09BN hpbbnn1/home/oracle/&amp;gt; STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&amp;gt; / as sysdba&lt;BR /&gt;&amp;gt; set head off feedback off&lt;BR /&gt;&amp;gt; select status from v\$instance;&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF)&lt;BR /&gt;10:00 GPOP09BN hpbbnn1/home/oracle/&amp;gt; echo "$STATUS"&lt;BR /&gt;&lt;BR /&gt;OPEN&lt;BR /&gt;10:00 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&amp;gt; / as sysdba&lt;BR /&gt;&amp;gt; set pages 0 feedback off&lt;BR /&gt;&amp;gt; select status from v\$instance;&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF)&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; echo "$STATUS"&lt;BR /&gt;OPEN&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This fix your problem about test.&lt;BR /&gt;Art&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 23 Sep 2005 03:01:08 GMT</pubDate>
    <dc:creator>Arturo Galbiati</dc:creator>
    <dc:date>2005-09-23T03:01:08Z</dc:date>
    <item>
      <title>Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928100#M104915</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;I have yet another Bourne shell vs POSIX shell question.&lt;BR /&gt;&lt;BR /&gt;In a script I check the database status using the following statements:&lt;BR /&gt;&lt;BR /&gt;# Check database status &lt;BR /&gt;STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ as sysdba&lt;BR /&gt;set heading off feedback off&lt;BR /&gt;select status from v\$instance;&lt;BR /&gt;exit&lt;BR /&gt;EOF)&lt;BR /&gt;&lt;BR /&gt;Now my question is:&lt;BR /&gt;When I test using the Bourne shell all works fine (see example 1), bur when I test the POSIX (preferred) way, it fails.&lt;BR /&gt;&lt;BR /&gt;#example1 &lt;BR /&gt;if [ ${STATUS} = "OPEN" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;  exit&lt;BR /&gt;fi   &lt;BR /&gt;The database started successfully!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#example2&lt;BR /&gt;if [[ ${STATUS} = "OPEN" ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;  exit&lt;BR /&gt;fi   &lt;BR /&gt;Database NOT open, status is: OPEN&lt;BR /&gt;&lt;BR /&gt;An echo \'${STATUS}\' returns  ' OPEN'&lt;BR /&gt;An echo \'"${STATUS}"\' returns '&lt;BR /&gt;OPEN'&lt;BR /&gt;&lt;BR /&gt;What is the best way to use the POSIX testing method (and make working)&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;&lt;BR /&gt;Renarios&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 04:10:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928100#M104915</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-09-22T04:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928101#M104916</link>
      <description>What are you getting on ${STATUS} Variable in both shells. Try as,&lt;BR /&gt;&lt;BR /&gt;# Check database status&lt;BR /&gt;STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ as sysdba&lt;BR /&gt;set heading off feedback off&lt;BR /&gt;select status from v\$instance;&lt;BR /&gt;exit&lt;BR /&gt;EOF)&lt;BR /&gt;echo ${STATUS}&lt;BR /&gt;&lt;BR /&gt;Execute and revert with results.&lt;BR /&gt;&lt;BR /&gt;Good scripting is as,&lt;BR /&gt;&lt;BR /&gt;if [[ "${STATUS}" = "OPEN" ]]&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 22 Sep 2005 04:17:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928101#M104916</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-22T04:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928102#M104917</link>
      <description>Hi hth, &lt;BR /&gt;here are the results:&lt;BR /&gt;$&amp;gt;$STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&amp;gt; / as sysdba&lt;BR /&gt;&amp;gt; set heading off feedback off&lt;BR /&gt;&amp;gt; select status from v\$instance;&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF)&lt;BR /&gt;$&amp;gt;echo ${STATUS}&lt;BR /&gt;OPEN&lt;BR /&gt;&lt;BR /&gt;The problem still exists:&lt;BR /&gt;if [[ "${STATUS}" = "OPEN" ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;fi&lt;BR /&gt;Database NOT open, status is: OPEN&lt;BR /&gt;&lt;BR /&gt;$&amp;gt;echo \'${STATUS}\'&lt;BR /&gt;' OPEN'&lt;BR /&gt;$&amp;gt;echo \'"${STATUS}"\'&lt;BR /&gt;'&lt;BR /&gt;OPEN'&lt;BR /&gt;&lt;BR /&gt;If I test using if [[ "${STATUS}" = ' OPEN' ]] it also doesn't work&lt;BR /&gt;&lt;BR /&gt;Any more ideas?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Renarios&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 04:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928102#M104917</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-09-22T04:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928103#M104918</link>
      <description>After getting ${STATUS} variable do like,&lt;BR /&gt;&lt;BR /&gt;echo ${STATUS} | od -dc&lt;BR /&gt;&lt;BR /&gt;Change the check statement like,&lt;BR /&gt;&lt;BR /&gt;if [ $(echo $STATUS | grep 'OPEN') = "OPEN" ]&lt;BR /&gt;then&lt;BR /&gt; echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;# Note: Don't use exit when executing shell statements with script.&lt;BR /&gt;&lt;BR /&gt;BTW: I am Muthukumar (hth - hope this helps)&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 22 Sep 2005 04:48:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928103#M104918</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-22T04:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928104#M104919</link>
      <description>Ehhhm whoops, sorry Muthukumar.&lt;BR /&gt;&lt;BR /&gt;The "echo ${STATUS} | od -dc" returns the following:&lt;BR /&gt;&lt;BR /&gt;echo ${STATUS} | od -dc&lt;BR /&gt;0000000   20304   17742   02560&lt;BR /&gt;          O   P   E   N  \n&lt;BR /&gt;0000005&lt;BR /&gt;&lt;BR /&gt;I didn't write the script myself, I'm only checking it on errors and rewriting it to POSIX. The exits in the script is another issue, but we'll solve that. &lt;BR /&gt;The option you gave is a good one.&lt;BR /&gt;Is there an option to use for the creation of the STATUS variable?&lt;BR /&gt;I know an option like: &lt;BR /&gt;# Remove leading CR/LF&lt;BR /&gt;status=$(echo ${STATUS} | cut -c 1-)&lt;BR /&gt;But that's very quick and dirty. Is there another way for that?&lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Thu, 22 Sep 2005 06:12:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928104#M104919</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-09-22T06:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928105#M104920</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To remove CR&lt;BR /&gt;&lt;BR /&gt;str=$(echo $str| tr -d '\r\032')&lt;BR /&gt;&lt;BR /&gt;To remove LF&lt;BR /&gt;&lt;BR /&gt;str=$(echo $str | tr -d '\r')</description>
      <pubDate>Thu, 22 Sep 2005 06:17:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928105#M104920</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-22T06:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928106#M104921</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Sorry for confusing. try to  use:&lt;BR /&gt;&lt;BR /&gt;sed 's/^M$//' &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 06:20:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928106#M104921</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-22T06:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928107#M104922</link>
      <description>I am not sure with od -dc output. It is correct as,&lt;BR /&gt;&lt;BR /&gt;# echo 'OPEN' | od -dc&lt;BR /&gt;0000000   20304   17742   02560&lt;BR /&gt;          O   P   E   N  \n&lt;BR /&gt;0000005&lt;BR /&gt;&lt;BR /&gt;Actually It is not good to get "STRING" as return value in shell scripting (my idea)!!. Try to use number for that easily as,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Check database status&lt;BR /&gt;STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ as sysdba&lt;BR /&gt;set heading off feedback off&lt;BR /&gt;select status from v\$instance;&lt;BR /&gt;exit&lt;BR /&gt;EOF) | grep -q 'OPEN'&lt;BR /&gt;&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;exit&lt;BR /&gt;fi &lt;BR /&gt;# END&lt;BR /&gt;&lt;BR /&gt;$? is the variable returns value of the previous command execution. I am requesting you to use it. Use like $? or ${?}&lt;BR /&gt;&lt;BR /&gt;May be problem with sh binary? Don't know.&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 06:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928107#M104922</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-22T06:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928108#M104923</link>
      <description>As for the stripping of line feeds proposed by raj,&lt;BR /&gt;afaik, the Unix line feed is \n or \012&lt;BR /&gt;(man ascii), so the transliteration should in my opinion read&lt;BR /&gt; &lt;BR /&gt;echo "$STATUS" | tr -d \\012&lt;BR /&gt; &lt;BR /&gt;Besides, there isn't such big difference between the HP Posix Shell and the Bash.&lt;BR /&gt;You could as well avoid word splitting in Bash in your test blocks by usage of the twin square brackets &lt;BR /&gt;e.g. &lt;BR /&gt;if [[ $STATUS = OPEN ]]; then ...&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 06:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928108#M104923</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-09-22T06:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928109#M104924</link>
      <description>Are you actually using the Bourne shell to test? In HP-UX, the Bourne shell is found in /usr/old/bin/sh and unless you specify the desired interpreter (shell) as your first line, the script will be run by whatever shell you are using at the moment. Always code the interpreter:&lt;BR /&gt; &lt;BR /&gt;#/usr/old/bin/sh&lt;BR /&gt; &lt;BR /&gt;or&lt;BR /&gt; &lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt; &lt;BR /&gt;And just like with Bourne, POSIX, Korn and BASH, you can trace the execution with set -x or run the script with the interpreter and the -x flag as in:&lt;BR /&gt; &lt;BR /&gt;/usr/old/bin/sh -x myscript&lt;BR /&gt; &lt;BR /&gt;Note that tracing is always sent to stderr so to pipe everything into more or pg, redirect stderr:&lt;BR /&gt; &lt;BR /&gt;/usr/bin/sh -x myscript 2&amp;gt;&amp;amp;1 | more&lt;BR /&gt; &lt;BR /&gt;As far as the OPEN not working, the result of the program is TWO lines, not one. Although octal it's a pain to read, it's clear that your sqlplus program returns a blank line followed by OPEN. So there are several ways to solve this:&lt;BR /&gt; &lt;BR /&gt;STATUS=$(echo "$STATUS | tail -1)&lt;BR /&gt; &lt;BR /&gt;but this suffers from the prblem that the sqlplu program may be unstable (not dependable to always write a blank line), so just use grep:&lt;BR /&gt; &lt;BR /&gt;if echo "$STATUS" | grep -q OPEN&lt;BR /&gt;then&lt;BR /&gt;echo "Database is OPEN"&lt;BR /&gt;else&lt;BR /&gt;echo "Database not open, status is \""$STATUS"\""&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;(note the use of extra " in the not-open status--it will delimit the beginning and end of the actual string)&lt;BR /&gt;&lt;BR /&gt;BTW: A much, much easier way to decode strings is to use hex:&lt;BR /&gt; &lt;BR /&gt;echo "$STATUS" | xd -xc&lt;BR /&gt; &lt;BR /&gt;Note that od and xd are the same program, so you can also use this:&lt;BR /&gt; &lt;BR /&gt;echo "$STATUS" | od -xc</description>
      <pubDate>Thu, 22 Sep 2005 07:06:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928109#M104924</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-09-22T07:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928110#M104925</link>
      <description>Hi Bill, &lt;BR /&gt;Since this script is executed by user oracle (non-root) I always code using the interpreter #!/usr/bin/sh. Is that correct?&lt;BR /&gt;&lt;BR /&gt;I will use the following in my script (which according my information is correct POSIX ):&lt;BR /&gt;STATUS=$(echo $(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;/ as sysdba&lt;BR /&gt;set heading off feedback off&lt;BR /&gt;select status from v\$instance;&lt;BR /&gt;exit&lt;BR /&gt;EOF) | tr -d \\012)&lt;BR /&gt;&lt;BR /&gt;# Use double brackets (My favorit)&lt;BR /&gt;if [[ ${STATUS} = "OPEN" ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Database NOT open, status is:"${STATUS}&lt;BR /&gt;  #exit &amp;lt;-- rewrite to return &lt;CODE&gt;&lt;BR /&gt;fi   &lt;BR /&gt;&lt;BR /&gt;Cheerio,&lt;BR /&gt;&lt;BR /&gt;Renarios&lt;/CODE&gt;</description>
      <pubDate>Thu, 22 Sep 2005 07:27:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928110#M104925</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-09-22T07:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928111#M104926</link>
      <description>Correct. The standard shell for HP-UX is the POSIX shell and is found in /usr/bin/sh. Unfortunately, this is exactly the same name used in other Unix flavors for the Bourne shell, thus endless confusion. It's really hard to find Bourne to POSIX shell conversion problems. Korn and Bash are also POSIX compliant shells so they more than 95% identical.</description>
      <pubDate>Thu, 22 Sep 2005 11:44:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928111#M104926</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-09-22T11:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928112#M104927</link>
      <description>Perhaps you could just change the test to&lt;BR /&gt;[[ "$STATUS" = "OPEN\n" ]].&lt;BR /&gt;&lt;BR /&gt;The thing I don't understand is how the&lt;BR /&gt;trailing newline is getting in there in the&lt;BR /&gt;first place.  The $() construct is supposed to&lt;BR /&gt;strip it: (from the man page)&lt;BR /&gt;&lt;BR /&gt;The standard output from a command enclosed in&lt;BR /&gt;parenthesis preceded by a dollar sign ($(...))&lt;BR /&gt;or a pair of grave accents (`...`) can be used&lt;BR /&gt;as part or all of a word; trailing newlines are &lt;BR /&gt;removed.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2005 12:35:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928112#M104927</guid>
      <dc:creator>Gregory Fruth</dc:creator>
      <dc:date>2005-09-22T12:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928113#M104928</link>
      <description>Hi renarios,&lt;BR /&gt;the problem is not related to teh shell, but to Oracle. You disable the header putting head off but not the new page. Instead of head off use pages 0 and SQL will retrun the status withou any control char:&lt;BR /&gt;&lt;BR /&gt;Your code:&lt;BR /&gt;09:58 GPOP09BN hpbbnn1/home/oracle/&amp;gt; STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&amp;gt; / as sysdba&lt;BR /&gt;&amp;gt; set head off feedback off&lt;BR /&gt;&amp;gt; select status from v\$instance;&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF)&lt;BR /&gt;10:00 GPOP09BN hpbbnn1/home/oracle/&amp;gt; echo "$STATUS"&lt;BR /&gt;&lt;BR /&gt;OPEN&lt;BR /&gt;10:00 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; STATUS=$(sqlplus -s &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&amp;gt; / as sysdba&lt;BR /&gt;&amp;gt; set pages 0 feedback off&lt;BR /&gt;&amp;gt; select status from v\$instance;&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; EOF)&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; echo "$STATUS"&lt;BR /&gt;OPEN&lt;BR /&gt;10:01 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This fix your problem about test.&lt;BR /&gt;Art&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2005 03:01:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928113#M104928</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-09-23T03:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928114#M104929</link>
      <description>Art,&lt;BR /&gt;&lt;BR /&gt;Check this on following the execution of sql as,&lt;BR /&gt;&lt;BR /&gt;if [[ ${STATUS} = "OPEN" ]]&lt;BR /&gt;then&lt;BR /&gt;echo "The database started successfully!"&lt;BR /&gt;else&lt;BR /&gt;echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;exit&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;You have to get "The database started successfully!" on getting ${STATUS} on POSIX shell.&lt;BR /&gt;&lt;BR /&gt;Try it and post result.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 23 Sep 2005 03:05:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928114#M104929</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-23T03:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928115#M104930</link>
      <description>10:08 GPOP09BN hpbbnn1/home/oracle/&amp;gt; if [[ ${STATUS} = "OPEN" ]]&lt;BR /&gt;&amp;gt; then&lt;BR /&gt;&amp;gt; echo "The database started successfully!"&lt;BR /&gt;&amp;gt; else&lt;BR /&gt;&amp;gt; echo "Database NOT open, status is:"$STATUS&lt;BR /&gt;&amp;gt; exit&lt;BR /&gt;&amp;gt; fi &lt;BR /&gt;The database started successfully!&lt;BR /&gt;10:09 GPOP09BN hpbbnn1/home/oracle/&amp;gt; &lt;BR /&gt;&lt;BR /&gt;Art</description>
      <pubDate>Fri, 23 Sep 2005 03:08:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928115#M104930</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2005-09-23T03:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Testing in  Bourne shell vs POSIX shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928116#M104931</link>
      <description>Thanks Bill, for the feedback. It meens I was informed correctly!&lt;BR /&gt;&lt;BR /&gt;Gregory, I already tried your test scenario, but that failed. I 'll dive into the man pages again.&lt;BR /&gt;&lt;BR /&gt;Art, You scored the lot! That was solution on my issue.&lt;BR /&gt;&lt;BR /&gt;Solution the reply from Art!&lt;BR /&gt;&lt;BR /&gt;Thanks to all who assisted me on this issue.&lt;BR /&gt;&lt;BR /&gt;Cheerio,&lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Fri, 23 Sep 2005 03:24:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/testing-in-bourne-shell-vs-posix-shell/m-p/4928116#M104931</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-09-23T03:24:50Z</dc:date>
    </item>
  </channel>
</rss>

