<?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: echo off without curses. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168195#M160797</link>
    <description>If done from with a C program, look at the getpass() (man getpass) function, termio (man termio) library or stty system call (man 2 stty).&lt;BR /&gt;All of these could be used to do what you want.</description>
    <pubDate>Tue, 20 Jan 2004 03:14:39 GMT</pubDate>
    <dc:creator>Elmar P. Kolkman</dc:creator>
    <dc:date>2004-01-20T03:14:39Z</dc:date>
    <item>
      <title>echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168187#M160789</link>
      <description>Anybody BTDT please? Dont need all the capabilities of curses, just want to turn echo off programatically.&lt;BR /&gt;&lt;BR /&gt;TIA,&lt;BR /&gt;jp</description>
      <pubDate>Mon, 19 Jan 2004 21:45:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168187#M160789</guid>
      <dc:creator>jp</dc:creator>
      <dc:date>2004-01-19T21:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168188#M160790</link>
      <description>stty -echo&lt;BR /&gt;&lt;BR /&gt;should do the trick.&lt;BR /&gt;&lt;BR /&gt;Mic</description>
      <pubDate>Mon, 19 Jan 2004 21:54:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168188#M160790</guid>
      <dc:creator>Mic V.</dc:creator>
      <dc:date>2004-01-19T21:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168189#M160791</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;'stty -echo' and 'stty echo' are the ones you are looking for. Below is an example script.&lt;BR /&gt;&lt;BR /&gt;printf "Enter your password:"&lt;BR /&gt;stty -echo&lt;BR /&gt;read passwd&lt;BR /&gt;stty echo&lt;BR /&gt;printf "\nYour password is $passwd\n"&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Mon, 19 Jan 2004 23:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168189#M160791</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-01-19T23:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168190#M160792</link>
      <description>Man 7 termio and all will be revealed but if all you want to do is turn echo off and read a string, by far, the easist method is the getpass() function. Man getpass for details.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 00:26:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168190#M160792</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-20T00:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168191#M160793</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;"stty - echo" will turn off the echo</description>
      <pubDate>Tue, 20 Jan 2004 00:58:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168191#M160793</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2004-01-20T00:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168192#M160794</link>
      <description>The solutions provided so far all look right, but I think the right answer depends on the language you try to use to program. In C it is done different from how it is done in a shell script...&lt;BR /&gt;&lt;BR /&gt;So more info can help in getting (possible) more precise answers...</description>
      <pubDate>Tue, 20 Jan 2004 01:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168192#M160794</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-20T01:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168193#M160795</link>
      <description>Thanks guys, looking a lot better. We need to do this from inside a program, so something in C is what I need. Termio ??? is the go? So far we are testing with stty -echo before starting the program, but preferable from inside the prog.&lt;BR /&gt;TIA,&lt;BR /&gt;jp</description>
      <pubDate>Tue, 20 Jan 2004 02:09:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168193#M160795</guid>
      <dc:creator>jp</dc:creator>
      <dc:date>2004-01-20T02:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168194#M160796</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Also you could tell us why you want to turn echo off. It's often to read a password and in this case you could use getpass() API which do it and turns off echo while reading ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 20 Jan 2004 03:06:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168194#M160796</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2004-01-20T03:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168195#M160797</link>
      <description>If done from with a C program, look at the getpass() (man getpass) function, termio (man termio) library or stty system call (man 2 stty).&lt;BR /&gt;All of these could be used to do what you want.</description>
      <pubDate>Tue, 20 Jan 2004 03:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168195#M160797</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-20T03:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168196#M160798</link>
      <description>We have LOTS of code doing Block mode HP screen reading (MPE), which means terminal does its own echoes, so you have to turn off system echo. This relieves the system of lots of load anyway. The length of the fields, and Block means getpass() wont do it. Sounds like termio or if stty is accessible from program, one of these will be the way to go.&lt;BR /&gt;Thanks&lt;BR /&gt;jp</description>
      <pubDate>Tue, 20 Jan 2004 05:50:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168196#M160798</guid>
      <dc:creator>jp</dc:creator>
      <dc:date>2004-01-20T05:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168197#M160799</link>
      <description>HP's blockmode supports password fields too, if I'm not mistaken. I don't have a manual of the HP terminal codes within reach, but there should be a field type available for this.</description>
      <pubDate>Tue, 20 Jan 2004 07:13:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168197#M160799</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-20T07:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168198#M160800</link>
      <description>Okay this should be a simple example of turning off echo:&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;TERMIOS.H&gt;&lt;BR /&gt;&lt;BR /&gt;#define STDIN_FDES 0&lt;BR /&gt;&lt;BR /&gt;struct termios save;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;  char s_tmp[80],*p = NULL;&lt;BR /&gt;  struct termios work;&lt;BR /&gt;  &lt;BR /&gt;  cc = tcgetattr(STDIN_FDES,&amp;amp;save);&lt;BR /&gt;  work = save;&lt;BR /&gt;  work.c_lflag &amp;amp;= ~(ECHO);&lt;BR /&gt;  cc = tcsetattr(STDIN_FDES,TCSANOW,&amp;amp;work);&lt;BR /&gt;  (void) printf("\nEnter value: ");&lt;BR /&gt;  (void) fflush(stdout);&lt;BR /&gt;  p = fgets(s_tmp,sizeof(s_tmp),stdin);&lt;BR /&gt;  if (p != NULL) (void) printf("Out -&amp;gt; %s\n",p);&lt;BR /&gt;  cc = tcsetattr(STDIN_FDES,TCSANOW,&amp;amp;save);&lt;BR /&gt;  return(cc);&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;NOTE: It is very important that you have signal handlers to catch SIGINT, SIGTERM, ... and reset the terminal using the original termios because the last tcsetattr() wins and this applies to the terminal device NOT simply the process. If you leave the process with echo off, it will be off in the shell as well.&lt;BR /&gt;&lt;/TERMIOS.H&gt;&lt;/STDLIB.H&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 20 Jan 2004 13:03:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168198#M160800</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-20T13:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168199#M160801</link>
      <description>I think we have a winner! Thanks Clay. As soon as we get this working, I will return with the news.&lt;BR /&gt;Thanks again everybody who responded.&lt;BR /&gt;&lt;BR /&gt;jp</description>
      <pubDate>Tue, 20 Jan 2004 16:11:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168199#M160801</guid>
      <dc:creator>jp</dc:creator>
      <dc:date>2004-01-20T16:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: echo off without curses.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168200#M160802</link>
      <description>Well, if you are going to use my snippet I might as well make it more robust. Note that I have added the signal handlers I mentioned earlier so that no matter what keys you press or if you kill it externally , the controlling terminal is restored to echo. The termio's function also allow you to do single character input without waiting for a LF or to timeout a read if a character is not received in a given period of time.&lt;BR /&gt;&lt;BR /&gt;I copied my original posting and spent about 3 minutes making him pretty.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 17:15:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/echo-off-without-curses/m-p/3168200#M160802</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-20T17:15:42Z</dc:date>
    </item>
  </channel>
</rss>

