Sponsored Content
Full Discussion: silent Input in PERL
Top Forums Shell Programming and Scripting silent Input in PERL Post 302664723 by drl on Saturday 30th of June 2012 10:39:09 AM
Old 06-30-2012
Hi, explorer007.

Also:
Code:
       ReadMode MODE [, Filehandle]
               Takes an integer argument, which can currently be one of the
               following values:

                   0    Restore original settings.
                   1    Change to cooked mode.
                   2    Change to cooked mode with echo off.
                         (Good for passwords)
                   3    Change to cbreak mode.
                   4    Change to raw mode.
                   5    Change to ultra-raw mode.
                         (LF to CR/LF translation turned off)

-- excerpt from perldoc Term::ReadKey, q.v.

Using perldoc is a way of solving problems for yourself.

Best wishes ... cheers, drl

-- PS meta-advice -- expecting answers in a specific (and short) amount of time, and bumping posts are behaviours unlikely to win friends and influence people in a positive manner.
This User Gave Thanks to drl For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

silent telnet

I have been using the following code for sending out an email from a AIX UNIX platform. cat filename | telnet mailhost 25 >/dev/null Time to time I get a message loopback: A specified file does not support the ioctl system call. Can anyone tell me what this means? I need this function... (1 Reply)
Discussion started by: cgardiner
1 Replies

2. Shell Programming and Scripting

getting input from perl

Hi, i have just tried something in perl #!/path/to/perl print "login: "; $login = <STDIN>; print "\npassword: "; $password = <STDIN>; print "Username=$login\n"; print "Password=$password\n"; And it doesnt work, anyone know how i can get more than one line? Cheers, Elfyn (2 Replies)
Discussion started by: emcb
2 Replies

3. HP-UX

SFTP silent login

Hi, I am connecting via SFTP to a remote Server. My problem is on trying to LOGin, I am asked for a password. I need to make this process automatic such that I can login without being prompted for a password. I can achieve this if the remote server has a simple FTP server and not SFTP. How... (6 Replies)
Discussion started by: sgaucho
6 Replies

4. Shell Programming and Scripting

[Perl] Silent Input

I would like to use the WWW::Mechanize module to access a webpage that is password-protected. I was wondering if there was a way to make the input silent when asked from the script. For example: What is your password: <password> Where <password> is where you put your password, but is silent... (2 Replies)
Discussion started by: eightysix
2 Replies

5. Linux

Wine in silent mode

I want to run through wine the utorrent and I don't want the messages that are usually displayed in the console, so I use the following command wine utorrent.exe > /dev/null & but it doesn't seem to work. Especially the redirection of the messages to the /dev/null doesn't work at all. Do... (1 Reply)
Discussion started by: myle
1 Replies

6. Linux

How to do a silent installation on linux

Hi, I am trying to do a silent installation of a JDk on a linux machine. Can anyone give me a command that would do it for me. Thanx Sundeep (2 Replies)
Discussion started by: eamani_sun
2 Replies

7. Shell Programming and Scripting

Silent Background Process

I run a background process using '&'. (see example below) How can I suppress the '&' messages that are written to my console?? (lines 2 and 5) Current Output... 1 > ak@LATU ~> ls & 2 > 4000 3 > ak@LATU ~> 4 > apps/ dl/ gems/ todo/ tst/ util/ 5 > + Done ... (1 Reply)
Discussion started by: andy210
1 Replies

8. Shell Programming and Scripting

Perl - pass shell-vars into perl for input loop

I need to process a file line-by-line using some value from a shell variable Something like:perl -p -e 's/$shell_srch/$shell_replace/g' input.txt I can't make the '-s' work in the '-p' or '-n' input loop (or couldn't find a syntaxis.) I have searched and found... (4 Replies)
Discussion started by: alex_5161
4 Replies

9. Shell Programming and Scripting

silent telnet and ssh using perl

Hi Experts, I use perl telnet and ssh for normal tasks and health checks. everything works fine but i would like to run scripts silently and print only data as i wish to. by silent i mean.no banners /no prompts/ nothing. I will format data before i print it on screen. just formatted... (3 Replies)
Discussion started by: mtomar
3 Replies

10. Shell Programming and Scripting

Looking for XARGS command Silent options

ls | grep -E '^+$' | xargs --verbose -I{} rm -vfr "{}"; When i execute the command it works fine by removing the directories and its writing the output as below about which files are deleting.What i want know is,is there any XARGS command option that it should done silently in background with... (2 Replies)
Discussion started by: nareshreddy443
2 Replies
curs_inopts(3X) 														   curs_inopts(3X)

NAME
cbreak, nocbreak, echo, noecho, halfdelay, intrflush, keypad, meta, nodelay, notimeout, raw, noraw, noqiflush, qiflush, timeout, wtimeout, typeahead - curses input options SYNOPSIS
#include <curses.h> int cbreak(void); int nocbreak(void); int echo(void); int noecho(void); int halfdelay(int tenths); int intrflush(WINDOW *win, bool bf); int keypad(WINDOW *win, bool bf); int meta(WINDOW *win, bool bf); int nodelay(WINDOW *win, bool bf); int raw(void); int noraw(void); void noqiflush(void); void qiflush(void); int notimeout(WINDOW *win, bool bf); void timeout(int delay); void wtimeout(WINDOW *win, int delay); int typeahead(int fd); DESCRIPTION
Normally, the tty driver buffers typed characters until a newline or carriage return is typed. The cbreak routine disables line buffering and erase/kill character-processing (interrupt and flow control characters are unaffected), making characters typed by the user immediately available to the program. The nocbreak routine returns the terminal to normal (cooked) mode. Initially the terminal may or may not be in cbreak mode, as the mode is inherited; therefore, a program should call cbreak or nocbreak explicitly. Most interactive programs using curses set the cbreak mode. Note that cbreak overrides raw. [See curs_getch(3X) for a dis- cussion of how these routines interact with echo and noecho.] The echo and noecho routines control whether characters typed by the user are echoed by getch as they are typed. Echoing by the tty driver is always disabled, but initially getch is in echo mode, so characters typed are echoed. Authors of most interactive programs prefer to do their own echoing in a controlled area of the screen, or not to echo at all, so they disable echoing by calling noecho. [See curs_getch(3X) for a discussion of how these routines interact with cbreak and nocbreak.] The halfdelay routine is used for half-delay mode, which is similar to cbreak mode in that characters typed by the user are immediately available to the program. However, after blocking for tenths tenths of seconds, ERR is returned if nothing has been typed. The value of tenths must be a number between 1 and 255. Use nocbreak to leave half-delay mode. If the intrflush option is enabled, (bf is TRUE), when an interrupt key is pressed on the keyboard (interrupt, break, quit) all output in the tty driver queue will be flushed, giving the effect of faster response to the interrupt, but causing curses to have the wrong idea of what is on the screen. Disabling (bf is FALSE), the option prevents the flush. The default for the option is inherited from the tty driver settings. The window argument is ignored. The keypad option enables the keypad of the user's terminal. If enabled (bf is TRUE), the user can press a function key (such as an arrow key) and wgetch returns a single value representing the function key, as in KEY_LEFT. If disabled (bf is FALSE), curses does not treat function keys specially and the program has to interpret the escape sequences itself. If the keypad in the terminal can be turned on (made to transmit) and off (made to work locally), turning on this option causes the terminal keypad to be turned on when wgetch is called. The default value for keypad is false. Initially, whether the terminal returns 7 or 8 significant bits on input depends on the control mode of the tty driver [see termio(7)]. To force 8 bits to be returned, invoke meta(win, TRUE); this is equivalent, under POSIX, to setting the CS8 flag on the terminal. To force 7 bits to be returned, invoke meta(win, FALSE); this is equivalent, under POSIX, to setting the CS7 flag on the terminal. The window argu- ment, win, is always ignored. If the terminfo capabilities smm (meta_on) and rmm (meta_off) are defined for the terminal, smm is sent to the terminal when meta(win, TRUE) is called and rmm is sent when meta(win, FALSE) is called. The nodelay option causes getch to be a non-blocking call. If no input is ready, getch returns ERR. If disabled (bf is FALSE), getch waits until a key is pressed. While interpreting an input escape sequence, wgetch sets a timer while waiting for the next character. If notimeout(win, TRUE) is called, then wgetch does not set a timer. The purpose of the timeout is to differentiate between sequences received from a function key and those typed by a user. The raw and noraw routines place the terminal into or out of raw mode. Raw mode is similar to cbreak mode, in that characters typed are immediately passed through to the user program. The differences are that in raw mode, the interrupt, quit, suspend, and flow control char- acters are all passed through uninterpreted, instead of generating a signal. The behavior of the BREAK key depends on other bits in the tty driver that are not set by curses. When the noqiflush routine is used, normal flush of input and output queues associated with the INTR, QUIT and SUSP characters will not be done [see termio(7)]. When qiflush is called, the queues will be flushed when these control characters are read. You may want to call noqiflush() in a signal handler if you want output to continue as though the interrupt had not occurred, after the handler exits. The timeout and wtimeout routines set blocking or non-blocking read for a given window. If delay is negative, blocking read is used (i.e., waits indefinitely for input). If delay is zero, then non-blocking read is used (i.e., read returns ERR if no input is waiting). If delay is positive, then read blocks for delay milliseconds, and returns ERR if there is still no input. Hence, these routines provide the same functionality as nodelay, plus the additional capability of being able to block for only delay milliseconds (where delay is positive). The curses library does ``line-breakout optimization'' by looking for typeahead periodically while updating the screen. If input is found, and it is coming from a tty, the current update is postponed until refresh or doupdate is called again. This allows faster response to commands typed in advance. Normally, the input FILE pointer passed to newterm, or stdin in the case that initscr was used, will be used to do this typeahead checking. The typeahead routine specifies that the file descriptor fd is to be used to check for typeahead instead. If fd is -1, then no typeahead checking is done. RETURN VALUE
All routines that return an integer return ERR upon failure and OK (SVr4 specifies only "an integer value other than ERR") upon successful completion, unless otherwise noted in the preceding routine descriptions. PORTABILITY
These functions are described in the XSI Curses standard, Issue 4. The ncurses library obeys the XPG4 standard and the historical practice of the AT&T curses implementations, in that the echo bit is cleared when curses initializes the terminal state. BSD curses differed from this slightly; it left the echo bit on at initialization, but the BSD raw call turned it off as a side-effect. For best portability, set echo or noecho explicitly just after initialization, even if your pro- gram remains in cooked mode. NOTES
Note that echo, noecho, halfdelay, intrflush, meta, nodelay, notimeout, noqiflush, qiflush, timeout, and wtimeout may be macros. The noraw and nocbreak calls follow historical practice in that they attempt to restore to normal (`cooked') mode from raw and cbreak modes respectively. Mixing raw/noraw and cbreak/nocbreak calls leads to tty driver control states that are hard to predict or understand; it is not recommended. SEE ALSO
curses(3X), curs_getch(3X), curs_initscr(3X), termio(7) curs_inopts(3X)
All times are GMT -4. The time now is 01:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy