05-09-2015
Hi,
Sorry about that. I tried RudiC's response without the LC_ALL part, which did not work, leading me to think that the input is different. However, I must say that both the solutions work.
Thanks!!
10 More Discussions You Might Find Interesting
1. AIX
Hello
A couple of weeks ago, I added a user to an AIX 5.3 system.
I go to add one today, and it appears that when creating a user in smit, I cannot see any groups.
No primary groups
No Group set
No Admin Groups
The /etc/group and etc/secuity/group files seem to be intact.
I did... (4 Replies)
Discussion started by: mhenryj
4 Replies
2. Windows & DOS: Issues & Discussions
Hi all,
need info on using putty as group.
I am having huge numbers of servers. (say 100)
I am using putty to login remotely. i want to group each 25 hostnames or a set of servers into one putty instance. (see image attached.)
Currently i have to scroll down to see all the 100 servers.
... (2 Replies)
Discussion started by: karthikn7974
2 Replies
3. Shell Programming and Scripting
I have some groups and when i issue a command like
groups $LOGNAME
it displays in one line
rfautosys c2ru cash2
I want to fetch only group starting with c2 but when i grep i am getting full line. Can someone advise
on this please as how i can get output as c2ru? (2 Replies)
Discussion started by: gehlnar
2 Replies
4. Solaris
how to create 1000 users in 1 group (0 Replies)
Discussion started by: tirupathi
0 Replies
5. Solaris
1 user in member of 4 groups find file permissions and default group (1 Reply)
Discussion started by: tirupathi
1 Replies
6. HP-UX
Hi all,
Can someone tell me how I can get around this problem. Basically I use the HP-UX OS and I work with 2 top level directories.
/z/group1
/z/group2
these 2 dirs are managed where group1 can only be access by one set of users and group2 another. This is managed by adding the 2... (3 Replies)
Discussion started by: cyberfrog
3 Replies
7. Shell Programming and Scripting
What is Primary group and Secondary Group in Unix.? (1 Reply)
Discussion started by: gwgreen1
1 Replies
8. UNIX for Dummies Questions & Answers
Hi
cat /etc/group :
....
oinstall:x:401:
dba:x:400:oracle
...
cat /etc/passwd|grep oracle
oracle:x:130:401::/home/oracle:/bin/ksh
1. Is that mean that :
ORACLE user has OINSTALL as it Primary group and DBA as secondary group ?
2. What is the linux comman to set ORACLE user with... (2 Replies)
Discussion started by: yoavbe
2 Replies
9. Shell Programming and Scripting
I have a requirement - replace specified positions in a string with a character. I found perl regex useful for this approach. however, I am facing the following issue.
The target file 'temp' contains -
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The goal is to convert... (5 Replies)
Discussion started by: sam_roy
5 Replies
10. UNIX for Dummies Questions & Answers
Must I be in a group? I am using Ubuntu and am the only user on my PC. I know how to change groups but do not see a way to not be in a group. Any help would be appreciated. (2 Replies)
Discussion started by: nthepines
2 Replies
LEARN ABOUT CENTOS
rpmatch
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.53 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)