<?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: Keyboard reading from ksh in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155764#M50376</link>
    <description>Thanks Guys last two posts was very helpfull ! &lt;BR /&gt;&lt;BR /&gt;The final way to solve this small affair is:&lt;BR /&gt;&lt;BR /&gt;    echo -n "Enter a character: "                  # prompt&lt;BR /&gt;    /bin/stty -icanon &amp;amp;&amp;amp; /bin/stty eol ^A&lt;BR /&gt;    key=`dd if=/dev/tty bs=1 count=1 2&amp;gt;/dev/null`  # read a key press&lt;BR /&gt;    /bin/stty icanon &amp;amp;&amp;amp; /bin/stty eol ^@&lt;BR /&gt;    echo "$key"    # echo newline and/or key -- OPTIONAL&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
    <pubDate>Thu, 12 Feb 2009 15:52:33 GMT</pubDate>
    <dc:creator>Leo The Cat</dc:creator>
    <dc:date>2009-02-12T15:52:33Z</dc:date>
    <item>
      <title>Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155756#M50368</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;How to accept only the ENTER key in a ksh compatible script to provide something like that:&lt;BR /&gt;"Please do action ... and press ENTER"&lt;BR /&gt;&lt;BR /&gt;any idea ?&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
      <pubDate>Mon, 09 Feb 2009 18:02:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155756#M50368</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-02-09T18:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155757#M50369</link>
      <description>Please tell us more on what you are trying to do...like where is your script failing?&lt;BR /&gt;&lt;BR /&gt;enjoy, life.&lt;BR /&gt;&lt;BR /&gt;Jean-Pierre Huc&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 09 Feb 2009 18:20:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155757#M50369</guid>
      <dc:creator>Huc_1</dc:creator>
      <dc:date>2009-02-09T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155758#M50370</link>
      <description>Shsalom,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is an example. Change the script and it will still work.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;filename="/home/paul/myfile.tar.gz"&lt;BR /&gt;hostname="ftp.myhost.com"&lt;BR /&gt;username="username"&lt;BR /&gt;password="password"&lt;BR /&gt;ftp -un $hostname &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;quote USER $username&lt;BR /&gt;quote PASS $password&lt;BR /&gt;&lt;BR /&gt;binary&lt;BR /&gt;put $filename&lt;BR /&gt;quit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 09 Feb 2009 19:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155758#M50370</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-02-09T19:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155759#M50371</link>
      <description>I'm not sure of what are you trying to do, but normally I use:&lt;BR /&gt;&lt;BR /&gt;echo "Press ENTER to continue"&lt;BR /&gt;read&lt;BR /&gt;echo "Operation complete"&lt;BR /&gt;exit 0</description>
      <pubDate>Mon, 09 Feb 2009 21:19:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155759#M50371</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2009-02-09T21:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155760#M50372</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;If you want to distinguish the action of pressing the ENTER key alone, you could do:&lt;BR /&gt;&lt;BR /&gt;# echo "press ENTER \c";read LINE;[ -z "${LINE}" ] &amp;amp;&amp;amp; echo OK || echo "Please just press ENTER"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 09 Feb 2009 21:27:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155760#M50372</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-09T21:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155761#M50373</link>
      <description>Hi Guys&lt;BR /&gt;&lt;BR /&gt;In fact, is there another keyboard function. (named readchar by example) I'd like to have only one striked key on input. &lt;BR /&gt;&lt;BR /&gt;ENTER key was not the good example because source of confusion on my question. sorry. &lt;BR /&gt;&lt;BR /&gt;Suppose you have choice between [Y]es or [N]o during execution script.  If the user press Y or N it's enough to continue and ENTER is not necessary. &lt;BR /&gt;&lt;BR /&gt;Is it possible ?&lt;BR /&gt;&lt;BR /&gt;Thanks Guys and sorry again about the confusion.&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2009 15:39:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155761#M50373</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-02-11T15:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155762#M50374</link>
      <description>&lt;!--!*#--&gt;Hi (again) Den:&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;# cat ./readchar&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "Enter character: \c"&lt;BR /&gt;stty  raw&lt;BR /&gt;readchar=$(dd if=/dev/tty bs=1 count=1 2 &amp;gt; /dev/null)&lt;BR /&gt;stty -raw&lt;BR /&gt;echo "\nYou pressed the '${readchar}' key"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Feb 2009 02:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155762#M50374</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-12T02:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155763#M50375</link>
      <description>if you want to be able to get any char&lt;BR /&gt;&lt;BR /&gt;SAVstty=$(stty -g)&lt;BR /&gt;stty raw min 1 time 0&lt;BR /&gt;a="$(od -A n -c -N 1)&lt;BR /&gt;stty $SAVstty&lt;BR /&gt;echo $a&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if you type a &lt;CR&gt; you will get \r&lt;BR /&gt;if you type a ^J  you will get \n&lt;BR /&gt;a backspace \b&lt;BR /&gt;a tab \t&lt;BR /&gt;.....&lt;BR /&gt;if you replace -c in od command by -x then you get the ascii value in hex.&lt;BR /&gt;&lt;BR /&gt;&lt;/CR&gt;</description>
      <pubDate>Thu, 12 Feb 2009 05:22:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155763#M50375</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-02-12T05:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Keyboard reading from ksh</title>
      <link>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155764#M50376</link>
      <description>Thanks Guys last two posts was very helpfull ! &lt;BR /&gt;&lt;BR /&gt;The final way to solve this small affair is:&lt;BR /&gt;&lt;BR /&gt;    echo -n "Enter a character: "                  # prompt&lt;BR /&gt;    /bin/stty -icanon &amp;amp;&amp;amp; /bin/stty eol ^A&lt;BR /&gt;    key=`dd if=/dev/tty bs=1 count=1 2&amp;gt;/dev/null`  # read a key press&lt;BR /&gt;    /bin/stty icanon &amp;amp;&amp;amp; /bin/stty eol ^@&lt;BR /&gt;    echo "$key"    # echo newline and/or key -- OPTIONAL&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
      <pubDate>Thu, 12 Feb 2009 15:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/keyboard-reading-from-ksh/m-p/5155764#M50376</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-02-12T15:52:33Z</dc:date>
    </item>
  </channel>
</rss>

