<?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: typeset question? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960914#M101265</link>
    <description>Simply use without typeset -i input setting.&lt;BR /&gt;&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read input &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo $input&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
    <pubDate>Mon, 20 Feb 2006 01:13:31 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2006-02-20T01:13:31Z</dc:date>
    <item>
      <title>typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960900#M101251</link>
      <description>hello experts,&lt;BR /&gt;&lt;BR /&gt;Can you advice why I can not echo the full value of $input?&lt;BR /&gt;&lt;BR /&gt;typeset -i input&lt;BR /&gt;&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read input &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo $input (it returns 0 ??)&lt;BR /&gt;&lt;BR /&gt;10 points for best solution!&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Feb 2006 03:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960900#M101251</guid>
      <dc:creator>lnl</dc:creator>
      <dc:date>2006-02-19T03:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960901#M101252</link>
      <description>You will have tocombine the lengthof inputin setting typeset -i input.&lt;BR /&gt;&lt;BR /&gt;man sh-posix</description>
      <pubDate>Sun, 19 Feb 2006 04:08:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960901#M101252</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-02-19T04:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960902#M101253</link>
      <description>Any quick example please. &lt;BR /&gt;Thanks</description>
      <pubDate>Sun, 19 Feb 2006 04:13:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960902#M101253</guid>
      <dc:creator>lnl</dc:creator>
      <dc:date>2006-02-19T04:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960903#M101254</link>
      <description>I do not have machinehandy at the moment.&lt;BR /&gt;But as i recall, there is option to set the lengthofa variable set with typeset.&lt;BR /&gt;&lt;BR /&gt;Something like like typeset -i10 input.&lt;BR /&gt;&lt;BR /&gt;This will acceptonly numbers less than or eqalto10 digits.</description>
      <pubDate>Sun, 19 Feb 2006 04:54:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960903#M101254</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-02-19T04:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960904#M101255</link>
      <description>Hmmm...&lt;BR /&gt;&lt;BR /&gt;I haven't an HP-UX box to try it on, but your script works fine on cygwin ksh and Linux bash.&lt;BR /&gt;&lt;BR /&gt;By the way, the argument, -i, allows you to specify what BASE the number will be, not it's length.  The default should be base10.&lt;BR /&gt;&lt;BR /&gt;How big of a number are you trying?  I suspect that it needs to be no bigger than 31 or 32-bit numbers, and probably is very platform dependent.</description>
      <pubDate>Sun, 19 Feb 2006 07:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960904#M101255</guid>
      <dc:creator>Vincent Fleming</dc:creator>
      <dc:date>2006-02-19T07:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960905#M101256</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try inserting the path to the shell interpreter, e.g.:&lt;BR /&gt;&lt;BR /&gt;$ cat  ./readme.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset -i input&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read input &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo "$input"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If your script always returns 0, it sounds as if it does not accept any input at all. However, it works well over here, e.g.:&lt;BR /&gt;&lt;BR /&gt;$  ./readme.sh&lt;BR /&gt;Enter numbers? 2147283648&lt;BR /&gt;2147283648&lt;BR /&gt;&lt;BR /&gt;but if you try numbers bigger than the above, 2^32-1, the result of the operation is undefined.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Sun, 19 Feb 2006 09:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960905#M101256</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2006-02-19T09:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960906#M101257</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Perhaps you want :&lt;BR /&gt;&lt;BR /&gt;typeset -Z input&lt;BR /&gt;&lt;BR /&gt;...instead of reading the input into a variable typeset with '-i'.  The '-Z' says right-justify and fill with leading zeros.&lt;BR /&gt;&lt;BR /&gt;Beware of doing arithmetic with leading zeros.  if UNIX95 is set, for instance, a leading zero signals octal and a leading 0x signals hexadecimal base.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 19 Feb 2006 10:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960906#M101257</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-02-19T10:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960907#M101258</link>
      <description>Guys,&lt;BR /&gt;&lt;BR /&gt;I think it's my fault that I didn't mention the number I'm trying to echo is in a form of octets. xx.xx.xx.xx? The $input variable always returns zero? &lt;BR /&gt;but if I enter numbers with no dots it echos correctly but that's not what I want anyway?&lt;BR /&gt;&lt;BR /&gt;James,&lt;BR /&gt;&lt;BR /&gt;"typeset -Z input" accept alphanumeric varialbls? I want it to accept numbers only with dots between them.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Feb 2006 12:59:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960907#M101258</guid>
      <dc:creator>lnl</dc:creator>
      <dc:date>2006-02-19T12:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960908#M101259</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you cannot do that by just defining af variable; you have to use other tools, e.g.:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset -Z input&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read input &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;CHECK1=$(echo "$input" | tr -d \.)&lt;BR /&gt;CHECK2=$(echo "$CHECK1" | tr -d [:digit:])&lt;BR /&gt;if [ "$CHECK2" = "" ]&lt;BR /&gt;then&lt;BR /&gt;        echo "$input"&lt;BR /&gt;else&lt;BR /&gt;        echo illegal input&lt;BR /&gt;fi&lt;BR /&gt;~&lt;BR /&gt;regards,&lt;BR /&gt;John K.~&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Feb 2006 13:11:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960908#M101259</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2006-02-19T13:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960909#M101260</link>
      <description>You can not use 'typeset -i' with the type of number you are entering.  '-i' means integer and you are not entering an integer value.&lt;BR /&gt;&lt;BR /&gt;You must rethink your use of typeset in this case.  You may just want to omit typeset altogether.</description>
      <pubDate>Sun, 19 Feb 2006 13:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960909#M101260</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-02-19T13:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960910#M101261</link>
      <description>typeset -i is for intergersonly. You are entering the intergers. Just read something will do.</description>
      <pubDate>Sun, 19 Feb 2006 15:49:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960910#M101261</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-02-19T15:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960911#M101262</link>
      <description>As mentioned, typeset -i is for a single integer. When you entered the dots for an IP address, typeset failed because the dot is illegal for an integer. You need to read your input as a string, then parse the string into the 4 numbers. You could also do this with IFS but this is more complex. Do you want the result of the 4 numbers to be converted into an integer?</description>
      <pubDate>Sun, 19 Feb 2006 20:40:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960911#M101262</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-02-19T20:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960912#M101263</link>
      <description>Bill,&lt;BR /&gt;&lt;BR /&gt;I want it to read numbers only with dots and then echo the full input. That's all.&lt;BR /&gt;&lt;BR /&gt;Any examples?&lt;BR /&gt;</description>
      <pubDate>Sun, 19 Feb 2006 21:08:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960912#M101263</guid>
      <dc:creator>lnl</dc:creator>
      <dc:date>2006-02-19T21:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960913#M101264</link>
      <description>You can do this:&lt;BR /&gt;&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read&lt;BR /&gt;echo "$REPLY"&lt;BR /&gt; &lt;BR /&gt;The read statement reads everything on the line and if no variable is specified, then everything is assigned to REPLY. You use a variable with mixed characters by surrounding it with double quotes.</description>
      <pubDate>Sun, 19 Feb 2006 23:11:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960913#M101264</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-02-19T23:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960914#M101265</link>
      <description>Simply use without typeset -i input setting.&lt;BR /&gt;&lt;BR /&gt;print "Enter numbers? \c"&lt;BR /&gt;read input &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;echo $input&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Mon, 20 Feb 2006 01:13:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960914#M101265</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-20T01:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: typeset question?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960915#M101266</link>
      <description>thanks</description>
      <pubDate>Fri, 24 Feb 2006 19:20:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/typeset-question/m-p/4960915#M101266</guid>
      <dc:creator>lnl</dc:creator>
      <dc:date>2006-02-24T19:20:03Z</dc:date>
    </item>
  </channel>
</rss>

