Sponsored Content
Full Discussion: OSX read silent with prompt
Top Forums Shell Programming and Scripting OSX read silent with prompt Post 302824291 by Just Ice on Thursday 20th of June 2013 03:01:42 PM
Old 06-20-2013
i do not understand the need not to see the response as it seems it is not that important enough to hide like you would a password ...

anyways, if you really do not want to see the user response -- see "man stty" ...
 

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. 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

3. Shell Programming and Scripting

echoed prompt not appearing until after read command.

I have a script I am runing on a hacked CDLinux live CD called from /etc/rc.d/rc.local. The part of th script in question goes like this. When run from rc.local the prompt "Centre name :" and the colour change does not appear until after I type the input text and press return. Also, I... (2 Replies)
Discussion started by: simonb
2 Replies

4. 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

5. Shell Programming and Scripting

read -p "prompt text" foo say "read: bad option(s)" in Bourne-Shell

Hallo, i need a Prompting read in my script: read -p "Enter your command: " command But i always get this Error: -p: is not an identifier When I run these in c-shell i get this error /usr/bin/read: read: bad option(s) How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies

6. 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

7. OS X (Apple)

How to prompt for login on OSX when starting Terminal

I was wondering if anyone can tell me how to log back in to unix after logging out. I have a MBPro. If I don't have the window close after exiting, then there is the phrase 'process completed' in brackets with a blinking cursor, but I can't type anything in. Is it also possible to start the... (4 Replies)
Discussion started by: Straitsfan
4 Replies

8. UNIX for Dummies Questions & Answers

pine email tool suppress prompt to save read messages

Could somebody please advise about how to configure pine/alpine so that on exit it doesn't prompt me to save read messages? Thanks (3 Replies)
Discussion started by: LeoKSimon
3 Replies

9. Shell Programming and Scripting

space after read prompt?

Hello, Unix-Forums. How can I make a Space after a read prompt? let's assume: read -p "Are you good?:" varthe output would be ( | is the cursor ): Are you good?:|But I want it to be: Are you good?: |That's what I mean. How would I do that? (2 Replies)
Discussion started by: intelinside
2 Replies

10. Shell Programming and Scripting

Using read to prompt for editable user input in Bash 3

Below is a simple script to prompt for user input while suggesting an editable default value at the prompt: shortname=user1 read -e -i $shortname -p "Please enter the username you would like to add: " input USERNAME="${input:-$shortname}" Please enter the username you would like to add:... (3 Replies)
Discussion started by: woodson2
3 Replies
RPMATCH(3)						     Linux Programmer's Manual							RPMATCH(3)

NAME
rpmatch - determine if the answer to a question is affirmative or negative SYNOPSIS
#include <stdlib.h> int rpmatch(const char *response); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): rpmatch(): _SVID_SOURCE DESCRIPTION
rpmatch() handles a user response to yes or no questions, with support for internationalization. response should be a null-terminated string containing a user-supplied response, perhaps obtained with fgets(3) or getline(3). The user's language preference is taken into account per the environment variables LANG, LC_MESSAGES, and LC_ALL, if the program has called setlocale(3) to effect their changes. Regardless of the locale, responses matching ^[Yy] are always accepted as affirmative, and those matching ^[Nn] are always accepted as neg- ative. RETURN VALUE
After examining response, rpmatch() returns 0 for a recognized negative response ("no"), 1 for a recognized positive response ("yes"), and -1 when the value of response is unrecognized. ERRORS
A return value of -1 may indicate either an invalid input, or some other error. It is incorrect to only test if the return value is nonzero. rpmatch() can fail for any of the reasons that regcomp(3) or regexec(3) can fail; the cause of the error is not available from errno or anywhere else, but indicates a failure of the regex engine (but this case is indistinguishable from that of an unrecognized value of response). CONFORMING TO
rpmatch() is not required by any standard, but is available on a few other systems. BUGS
The rpmatch() implementation looks at only the first character of response. As a consequence, "nyes" returns 0, and "ynever; not in a mil- lion years" returns 1. It would be preferable to accept input strings much more strictly, for example (using the extended regular expres- sion notation described in regex(7)): ^([yY]|yes|YES)$ and ^([nN]|no|NO)$. EXAMPLE
The following program displays the results when rpmatch() is applied to the string given in the program's command-line argument. #define _SVID_SOURCE #include <locale.h> #include <stdlib.h> #include <string.h> #include <stdio.h> int main(int argc, char *argv[]) { if (argc != 2 || strcmp(argv[1], "--help") == 0) { fprintf(stderr, "%s response ", argv[0]); exit(EXIT_FAILURE); } setlocale(LC_ALL, ""); printf("rpmatch() returns: %d ", rpmatch(argv[1])); exit(EXIT_SUCCESS); } SEE ALSO
fgets(3), getline(3), nl_langinfo(3), regcomp(3), setlocale(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2007-07-26 RPMATCH(3)
All times are GMT -4. The time now is 10:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy