<?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: Reading Keyboard inputs in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152491#M72865</link>
    <description>A terminal is a terminal.&lt;BR /&gt;&lt;BR /&gt;stdin is the keyboard.  That should do it.&lt;BR /&gt;&lt;BR /&gt;The read command stops the program nicely and waits for input followed by a return.&lt;BR /&gt;&lt;BR /&gt;That should be enough unless you want to script it.&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; input_file&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Fri, 26 Dec 2003 03:31:32 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2003-12-26T03:31:32Z</dc:date>
    <item>
      <title>Reading Keyboard inputs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152490#M72864</link>
      <description>Can i give input to Gnome-terminal using programs(in C or Java)?.&lt;BR /&gt;&lt;BR /&gt;If i give the input to one Gnome-terminal like ls,hostname and etc.How can i get the commands from the terminal in my program?.&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Dec 2003 00:25:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152490#M72864</guid>
      <dc:creator>Sudhakar.S</dc:creator>
      <dc:date>2003-12-26T00:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Keyboard inputs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152491#M72865</link>
      <description>A terminal is a terminal.&lt;BR /&gt;&lt;BR /&gt;stdin is the keyboard.  That should do it.&lt;BR /&gt;&lt;BR /&gt;The read command stops the program nicely and waits for input followed by a return.&lt;BR /&gt;&lt;BR /&gt;That should be enough unless you want to script it.&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; input_file&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 26 Dec 2003 03:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152491#M72865</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-26T03:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Keyboard inputs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152492#M72866</link>
      <description>However, if you want to use C it all gets a little more complicated.  You can use the standard C routines such as getc and scanf and all that but they are all a little disappointing because linux, like unix, will not give you anything until the "enter" key is pressed.&lt;BR /&gt; &lt;BR /&gt;All is not lost, however, because you can change this behavior by changing the terminal into what is know as "raw" mode.  In other words, characters are "unbuffered" which basically means your "getc()" works as you would expect.  Sadly, this can drastically slow the application down if you don't handle it correctly. Single character at a time reads, are horribley expensive when you do lots and lots of them so use functions that read specified number of characters when you can.&lt;BR /&gt; &lt;BR /&gt;For all of this, there is no useful "man" page that I have ever found but a quick google search turned up the following link which might be usefull.&lt;BR /&gt; &lt;A href="http://linux.cis.nctu.edu.tw/docs/woven/HOWTO/Serial-Programming-HOWTO-2.html" target="_blank"&gt;http://linux.cis.nctu.edu.tw/docs/woven/HOWTO/Serial-Programming-HOWTO-2.html&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt;If all this sounds all a bit horrid have a look at the "curses" package which does most of the nasty stuff for you and makes doing cursor positioning stuff a lot easier too.&lt;BR /&gt; &lt;BR /&gt;Sorry, can't help you on the Java front though.</description>
      <pubDate>Mon, 29 Dec 2003 03:42:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/reading-keyboard-inputs/m-p/3152492#M72866</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-29T03:42:48Z</dc:date>
    </item>
  </channel>
</rss>

