Sponsored Content
Full Discussion: Very simple question
Top Forums UNIX for Dummies Questions & Answers Very simple question Post 302080331 by reborg on Monday 17th of July 2006 07:10:54 PM
Old 07-17-2006
elul21 Take this as a warning, the kind of response you gave will see you banned.


In response to the question, try with single quote. You should also read the man pages for your shell, in particular the section on special characters.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Simple Question

Friends, I did following exercise $ echo '' > test $ od -b test $ echo "">test $ od -b test $echo > test $od -b test Every time I got the following output 0000000 012 0000001 But 012 is octal value for new line character . Even though there is no apperent new line character... (6 Replies)
Discussion started by: j1yant
6 Replies

2. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies

3. Programming

Simple C question... Hopefully it's simple

Hello. I'm a complete newbie to C programming. I have a C program that wasn't written by me where I need to write some wrappers around it to automate and make it easier for a client to use. The problem is that the program accepts standard input to control the program... I'm hoping to find a simple... (6 Replies)
Discussion started by: Xeed
6 Replies

4. UNIX for Dummies Questions & Answers

Simple Question

Hi Guys, I've been learning UNIX for the past couple of days and I came across this exercise, I can't get my head around it, so I would be ever so grateful if I could receive some sort of help or direction with this. Create a file with x amount of lines in it, the content of your choice. ... (3 Replies)
Discussion started by: aforball
3 Replies

5. Shell Programming and Scripting

Simple ls question

i am doing ls -la in the out put , first line is as total 41621 What is this total? (2 Replies)
Discussion started by: Saurabh78
2 Replies

6. Shell Programming and Scripting

Simple Question

Hi, Please don't berate me over the simplicity of these questions. I have recently gotten into bash shell scripting and enjoy it quite a bit. One thing I have not found the answer to though is when naming a shell script, what extension is normally used (ie myscript.?)? Also where is the standard... (5 Replies)
Discussion started by: msb65
5 Replies

7. UNIX for Dummies Questions & Answers

Simple question

I had a script in solaris wich i read data, for example: Number 1: _ and the cursor use to be in '_' place because in the code of the script i write: echo "Number 1:\c" but i copy the script to a linux and the cursor 'jump' to the begining of the next line like: Number 1:... (2 Replies)
Discussion started by: lestat_ecuador
2 Replies

8. UNIX for Dummies Questions & Answers

simple question

hi everybody; trying to c unix programming and ive stucked with a problem: simple program filedr=open("tempfile",O_RDWR|O_TRUNC,0); write(filedr,msg1,6); int i; i=read(filedr,msg3,4); it returns 0 bytes read ... why? well if i try to poll() before read , it doesnt indicate POLLHUP or... (4 Replies)
Discussion started by: IdleProc
4 Replies

9. Shell Programming and Scripting

Simple if then else question

I am having trouble making this statement work. I am passing in a number value for the number of days to keep archive logs for and wanted to make sure that it is a number. I have a script that will return 1 for is a number and 0 for is not a number. I also want to make sure that the number is not... (2 Replies)
Discussion started by: gandolf989
2 Replies

10. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 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(): Since glibc 2.19: _DEFAULT_SOURCE Glibc 2.19 and earlier: _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). ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+----------------+ |Interface | Attribute | Value | +----------+---------------+----------------+ |rpmatch() | Thread safety | MT-Safe locale | +----------+---------------+----------------+ 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 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2017-09-15 RPMATCH(3)
All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy