<?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 bash &amp;amp; typeset / declare in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948347#M65601</link>
    <description>I am just starting to get into some Linux administration with Suse Linux Enterprise Server (SLES) 10.  I currently have 1 test machine, but plans for 3 or 4 more this year.&lt;BR /&gt;&lt;BR /&gt;Anyway, I am starting to write some bash shell scripts in SLES.  The problem I have is that apparently 'typeset -u' is not supported in bash.  I am used to using this in HP-UX (Posix shell) to force a variable to be upper case.  This is very handy when getting user input.&lt;BR /&gt;&lt;BR /&gt;Is there some functional equivalent to HP-UX 'typeset -u' in bash?&lt;BR /&gt;&lt;BR /&gt;I'm using an awk hack to force the variable to uppercase, but I'd rather not have that extra overhead.&lt;BR /&gt;&lt;BR /&gt;The version of bash I have is:&lt;BR /&gt;&lt;BR /&gt;$ echo $BASH_VERSION&lt;BR /&gt;3.1.17(1)-release&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 20 Feb 2007 19:15:39 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2007-02-20T19:15:39Z</dc:date>
    <item>
      <title>bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948347#M65601</link>
      <description>I am just starting to get into some Linux administration with Suse Linux Enterprise Server (SLES) 10.  I currently have 1 test machine, but plans for 3 or 4 more this year.&lt;BR /&gt;&lt;BR /&gt;Anyway, I am starting to write some bash shell scripts in SLES.  The problem I have is that apparently 'typeset -u' is not supported in bash.  I am used to using this in HP-UX (Posix shell) to force a variable to be upper case.  This is very handy when getting user input.&lt;BR /&gt;&lt;BR /&gt;Is there some functional equivalent to HP-UX 'typeset -u' in bash?&lt;BR /&gt;&lt;BR /&gt;I'm using an awk hack to force the variable to uppercase, but I'd rather not have that extra overhead.&lt;BR /&gt;&lt;BR /&gt;The version of bash I have is:&lt;BR /&gt;&lt;BR /&gt;$ echo $BASH_VERSION&lt;BR /&gt;3.1.17(1)-release&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Feb 2007 19:15:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948347#M65601</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-02-20T19:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948348#M65602</link>
      <description>Hi Patrick!&lt;BR /&gt;&lt;BR /&gt;It appears that uppercase and lowercase typeset (declare) options don't exist in the Bash shell.  You're left with:&lt;BR /&gt;&lt;BR /&gt;# VAR="patrick wallek"&lt;BR /&gt;# TOUPPER="$(echo "${VAR}"|tr 'a-z' 'A-Z')"&lt;BR /&gt;&lt;BR /&gt;At least that's probably cheaper than 'awk'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Feb 2007 20:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948348#M65602</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-20T20:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948349#M65603</link>
      <description>Jim,&lt;BR /&gt;&lt;BR /&gt;I never think about tr for some reason.  You're probably right about it being cheaper than awk.&lt;BR /&gt;&lt;BR /&gt;I was doing a bit of research earlier and I do have ksh on SLES and ksh does have the '-u' available in typeset.  That could be an option as well.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Feb 2007 21:04:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948349#M65603</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-02-20T21:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948350#M65604</link>
      <description>If you're wanting it for comparison of user-input to a predefined string, you can use:&lt;BR /&gt;&lt;BR /&gt;shopt nocaseglob&lt;BR /&gt;&lt;BR /&gt;This tells the inbuilt 'test' ([) to ignore character case in comparisons.&lt;BR /&gt;&lt;BR /&gt;With the 'ksh' options (there's ksh, and pdksh), be careful.  From my experience, they aren't 100% compatable with most other ksh versions.</description>
      <pubDate>Tue, 20 Feb 2007 22:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948350#M65604</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-02-20T22:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948351#M65605</link>
      <description>This will also work:&lt;BR /&gt;&lt;BR /&gt;# TOUPPER="$(echo "${VAR}"|tr [:lower:] [:upper:])"</description>
      <pubDate>Wed, 21 Feb 2007 08:19:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948351#M65605</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-02-21T08:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948352#M65606</link>
      <description>I know the "tr" statements will work.  For some reason I've got a mental block on 'tr' and always forget about it.&lt;BR /&gt;&lt;BR /&gt;The really handy thing is the 'shopt' bash built-in.&lt;BR /&gt;&lt;BR /&gt;The "nocaseglob" did not work and on further research (the man page) it appears that nocaseglob is for case-insensitive filename matching.  &lt;BR /&gt;&lt;BR /&gt;However, "nocasematch" is what I need.  It is used when matching patterns in case statements or when doing tests.&lt;BR /&gt;&lt;BR /&gt;shopt -s nocasematch&lt;BR /&gt;&lt;BR /&gt;causes y to equal Y ; yes = Yes = yEs = yeS = YES&lt;BR /&gt;&lt;BR /&gt;which is what I want.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 09:14:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948352#M65606</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-02-21T09:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: bash &amp; typeset / declare</title>
      <link>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948353#M65607</link>
      <description>Oops, apologies.. Read the man page to grab that one.. Must have done hte whole eye-hand-wrong-line-coordination thing again.. ;)&lt;BR /&gt;&lt;BR /&gt;There's a reason I print documentation out :P&lt;BR /&gt;&lt;BR /&gt;(0 pts)</description>
      <pubDate>Wed, 21 Feb 2007 17:17:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/bash-amp-typeset-declare/m-p/3948353#M65607</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-02-21T17:17:34Z</dc:date>
    </item>
  </channel>
</rss>

