<?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: restricting characters read in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526808#M728619</link>
    <description>Praveen,&lt;BR /&gt;&lt;BR /&gt;As far as I know , read does not have any option to count the number of characters. But you can try something like this :-&lt;BR /&gt;&lt;BR /&gt;read DUMMY&lt;BR /&gt;LENGTH=`echo ${DUMMY}|wc -m`&lt;BR /&gt;if [ "${LENGTH}" -gt 8 ]; then&lt;BR /&gt; ANSWER=`echo ${DUMMY} | cut -c 1-8`&lt;BR /&gt;else&lt;BR /&gt;  ANSWER="${DUMMY}"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;And use the value of ANSWER to put the 8 character restriction.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Praveen</description>
    <pubDate>Thu, 10 May 2001 13:10:46 GMT</pubDate>
    <dc:creator>Gadura Praveen</dc:creator>
    <dc:date>2001-05-10T13:10:46Z</dc:date>
    <item>
      <title>restricting characters read</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526807#M728618</link>
      <description>Hi&lt;BR /&gt;   In shell scripting, can we restrict the number of character read ,using the &lt;BR /&gt;'read' keyword.</description>
      <pubDate>Thu, 10 May 2001 10:25:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526807#M728618</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-05-10T10:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: restricting characters read</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526808#M728619</link>
      <description>Praveen,&lt;BR /&gt;&lt;BR /&gt;As far as I know , read does not have any option to count the number of characters. But you can try something like this :-&lt;BR /&gt;&lt;BR /&gt;read DUMMY&lt;BR /&gt;LENGTH=`echo ${DUMMY}|wc -m`&lt;BR /&gt;if [ "${LENGTH}" -gt 8 ]; then&lt;BR /&gt; ANSWER=`echo ${DUMMY} | cut -c 1-8`&lt;BR /&gt;else&lt;BR /&gt;  ANSWER="${DUMMY}"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;And use the value of ANSWER to put the 8 character restriction.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Praveen</description>
      <pubDate>Thu, 10 May 2001 13:10:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526808#M728619</guid>
      <dc:creator>Gadura Praveen</dc:creator>
      <dc:date>2001-05-10T13:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: restricting characters read</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526809#M728620</link>
      <description>&lt;BR /&gt;WARNING : it is a very hard response&lt;BR /&gt;&lt;BR /&gt;This output is from a menubased aplication:stty -a &amp;lt; /dev/pts/tb                                                                                                 &lt;BR /&gt;speed 9600 baud; line = 0;                                                                                                          &lt;BR /&gt;rows = 25; columns = 132                                                                                                            &lt;BR /&gt;min = 1; time = 0;                                                                                                                  &lt;BR /&gt;intr = ^U; quit = ^\; erase = ^H; kill = ^C                                                                                         &lt;BR /&gt;eof = ^D; eol = ^@; eol2 &lt;UNDEF&gt;; swtch &lt;UNDEF&gt;                                                                                     &lt;BR /&gt;stop = ^S; start = ^Q; susp &lt;UNDEF&gt;; dsusp &lt;UNDEF&gt;                                                                                  &lt;BR /&gt;werase &lt;UNDEF&gt;; lnext &lt;UNDEF&gt;                                                                                                       &lt;BR /&gt;parenb -parodd cs8 -cstopb hupcl -cread -clocal -loblk -crts                                                                        &lt;BR /&gt;-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -iuclc                                                            &lt;BR /&gt;-ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak                                                                                &lt;BR /&gt;-isig -icanon -iexten -xcase -echo echoe echok -echonl -noflsh                                                                      &lt;BR /&gt;-echoctl -echoprt -echoke -flusho -pendin                                                                                           &lt;BR /&gt;opost -olcuc -onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop        &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;____&lt;BR /&gt;&lt;BR /&gt;min=1 ; time = 0 &lt;BR /&gt;&lt;BR /&gt;this parameters let keep a only char from keyboard.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;See man stty.&lt;BR /&gt;&lt;BR /&gt;AND good luck.&lt;BR /&gt;&lt;/UNDEF&gt;&lt;/UNDEF&gt;&lt;/UNDEF&gt;&lt;/UNDEF&gt;&lt;/UNDEF&gt;&lt;/UNDEF&gt;</description>
      <pubDate>Thu, 10 May 2001 13:31:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526809#M728620</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-05-10T13:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: restricting characters read</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526810#M728621</link>
      <description>Praveen:&lt;BR /&gt;&lt;BR /&gt;You can alter the IFS character and thereby redefine the words read by 'read'.&lt;BR /&gt;&lt;BR /&gt;See "read" and "IFS" in 'man sh-posix'.&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 May 2001 13:48:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/restricting-characters-read/m-p/2526810#M728621</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-05-10T13:48:19Z</dc:date>
    </item>
  </channel>
</rss>

