<?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: sh/bash question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180235#M162773</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;'set -u' does the trick for you  in posix and ksh. Not sure about bash though.&lt;BR /&gt;&lt;BR /&gt;set -u&lt;BR /&gt;echo "$VAR"&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
    <pubDate>Mon, 02 Feb 2004 10:44:51 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2004-02-02T10:44:51Z</dc:date>
    <item>
      <title>sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180234#M162772</link>
      <description>Hello,&lt;BR /&gt;when I'm in sh/bash and I execute variable that do not exists, I don't get any message. Nothing happens:&lt;BR /&gt;srv1&amp;gt; $blablabla&lt;BR /&gt;srv1&amp;gt; echo $?&lt;BR /&gt;0&lt;BR /&gt;srv1&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Well, I believe that it's ok, but I would like it to tell me that variable was not set and do not exist (like in csh and tcsh). &lt;BR /&gt;Is it possible?&lt;BR /&gt;&lt;BR /&gt;Thanx</description>
      <pubDate>Mon, 02 Feb 2004 10:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180234#M162772</guid>
      <dc:creator>Alex Lavrov</dc:creator>
      <dc:date>2004-02-02T10:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180235#M162773</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;'set -u' does the trick for you  in posix and ksh. Not sure about bash though.&lt;BR /&gt;&lt;BR /&gt;set -u&lt;BR /&gt;echo "$VAR"&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 02 Feb 2004 10:44:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180235#M162773</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-02-02T10:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180236#M162774</link>
      <description>HPUX posix shell does complain if you execute a $VAR on the command line...&lt;BR /&gt;&lt;BR /&gt;# $VAR&lt;BR /&gt;sh: VAR: Parameter not set.&lt;BR /&gt;&lt;BR /&gt;# echo $VAR&lt;BR /&gt;sh: VAR: Parameter not set.</description>
      <pubDate>Mon, 02 Feb 2004 10:46:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180236#M162774</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2004-02-02T10:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180237#M162775</link>
      <description>Regardless of the set, ${srv1:?} notation does the job too. Regards.</description>
      <pubDate>Mon, 02 Feb 2004 12:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180237#M162775</guid>
      <dc:creator>Jan Zalman</dc:creator>
      <dc:date>2004-02-02T12:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180238#M162776</link>
      <description>I have found variable assignment works exactly the same in bash verus posix and korn.&lt;BR /&gt;&lt;BR /&gt;I've taken A. Clay Stephenson's caljd.sh scripts, changed the shell and gotten completely consistent results.&lt;BR /&gt;&lt;BR /&gt;filevar=steve.file&lt;BR /&gt;export filevar&lt;BR /&gt;&lt;BR /&gt;while read -r aa&lt;BR /&gt;do&lt;BR /&gt;   echo $aa&lt;BR /&gt;done &amp;lt; $filevar&lt;BR /&gt;&lt;BR /&gt;Will work in all three shells.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Feb 2004 12:44:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180238#M162776</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-02-02T12:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180239#M162777</link>
      <description>Well,&lt;BR /&gt;&lt;BR /&gt;I think (as stated already by someone else)&lt;BR /&gt;'set -u' does the trick.&lt;BR /&gt;It means: treats unset variables as an error.&lt;BR /&gt;&lt;BR /&gt;Apparently in your shell this has not been executed, so if you type $blablabla as a command, nothing gets executed. Apparently Todd 's shell has been told to treat unset variables as an error.&lt;BR /&gt;&lt;BR /&gt;In addition I would suggest to add 'set -u' to your own shell scripts. It makes debugging easier (misspelled variables are detected immediately) and may prevent you from erasing a wrong directory.&lt;BR /&gt;&lt;BR /&gt;I could not test Jan's solution...&lt;BR /&gt;&lt;BR /&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;JP.</description>
      <pubDate>Mon, 02 Feb 2004 13:20:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180239#M162777</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2004-02-02T13:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: sh/bash question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180240#M162778</link>
      <description>*Thanx a lot* for the answers. I'll try it first thing in the morning and assign points to all.&lt;BR /&gt;&lt;BR /&gt;Best regards</description>
      <pubDate>Mon, 02 Feb 2004 14:29:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sh-bash-question/m-p/3180240#M162778</guid>
      <dc:creator>Alex Lavrov</dc:creator>
      <dc:date>2004-02-02T14:29:45Z</dc:date>
    </item>
  </channel>
</rss>

