Bash-Linux.com : Le SHELL pour les nuls

  Actuellement 50 lignes de commande et 1472 man disponibles
login as: root
root@213.186.33.18's password:
Last login: Wed May 30 7:38:16 2012 from 38.107.179.226
[root@bash-linux ~] # echo "Bienvenue sur Bash-Linux.com"_
 Manuel des commandes UNIX (man) Version anglaise

Indiquez la fonction :

Man Rpmatch en anglais

RPMATCH(3) Linux Programmer's Manual RPMATCH(3)
 
NAME


rpmatch - determine if the answer to a question is affirmative or nega- tive
 
SYNOPSIS


#include 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 environ- ment 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 nega- tive.
 
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 non- zero. 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 any- where 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 million years" returns 1. It would be preferable to accept input strings much more strictly, for example (using the extended regular expression 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 #include #include #include int main(int argc, char *argv[]) { if (argc != 2 || strcmp(argv[1], "--help") == 0) { fprintf(stderr, "%s response\n", argv[0]); exit(EXIT_FAILURE); } setlocale(LC_ALL, ""); printf("rpmatch() returns: %d\n", 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.05 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)


 Dernières recherches
Man  en anglais Man rpmatch en anglaisMan  en français Man rpmatch en français
Man  en anglais Man rpcinfo en anglaisMan  en français Man rpcinfo en français
Man  en anglais Man round en anglaisMan  en français Man round en français
Man  en anglais Man rmdir en anglaisMan  en français Man rmdir en français
Man  en anglais Man rlogin en anglaisMan  en français Man rlogin en français
Man  en anglais Man rewind en anglaisMan  en français Man rewind en français
Man  en anglais Man rev en anglaisMan  en français Man rev en français
Man  en anglais Man resize_reiserfs en anglaisMan  en français Man resize_reiserfs en français
Man  en anglais Man reset en anglaisMan  en français Man reset en français
Man  en anglais Man req en anglaisMan  en français Man req en français
Man  en anglais Man replace en anglaisMan  en français Man replace en français
Man  en anglais Man renice en anglaisMan  en français Man renice en français
Man  en anglais Man renameat en anglaisMan  en français Man renameat en français
Man  en anglais Man remquo en anglaisMan  en français Man remquo en français
Man  en anglais Man remainder en anglaisMan  en français Man remainder en français

 Recherche

Dans ce moteur de recherche, vous pouvez taper directement votre besoin, en une phrase normale, humaine.
Exemple : vous cherchez comment remplacer un mot par un autre dans tous les fichiers d'un certain dossier. Vous pouvez écrire "Comment remplacer un mot par un autre dans tous les fichiers d'un dossier". Le moteur vous ramenera les résultats en fonction de leur pertinence.
Vous pouvez bien sûr ne chercher qu'un seul mot-clé, par exemple "find".
 Toutes les lignes de code
Par popularité
Par fonction
Recherche avancée
 Les logiciels SHELL/SSH
Putty
Astuces Bash
Faire du SHELL avec PHP!
 La doc officielle
Les man Linux en français
Les man Linux en anglais
 Proposer vos bash
Partagez vos lignes!
 Les requêtes
Déposer une requête
Voir/répondre à une requête
 Quelques sites interessants
Bons sites pour apprendre
 Rechercher