Deutsch   English   Français   Italiano  
<slrnt5ali3.51a.lhh+news-no_spam@hercule.home.arpa>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Jacques L'helgoualc'h <lhh+news-no_spam@free.fr.isnt.invalid>
Newsgroups: fr.comp.os.linux.configuration
Subject: Re: Configuration d'un super PC Linux pour Ghost "Michu" Raider -
 questions sur le langage de commande
Date: Tue, 12 Apr 2022 10:36:51 -0000 (UTC)
Organization: Aucune.
Lines: 25
Message-ID: <slrnt5ali3.51a.lhh+news-no_spam@hercule.home.arpa>
References: <t2f9qm$8hh$1@dont-email.me> <t2ffi3$2acr$1@news.gegeweb.eu>
 <t2fmhl$mca$1@dont-email.me> <t2gtq9$d11$2@news.gegeweb.eu>
 <t2h254$buh$1@dont-email.me> <t2h7tk$jtf$1@news.gegeweb.eu>
 <t2hds0$bsn$1@dont-email.me> <t2hick$9gd$1@ns507557.dodin.fr.nf>
 <t2hne3$8mm$1@dont-email.me> <t2jcfi$1s4n$1@gioia.aioe.org>
 <t2jgu8$9bq$1@dont-email.me> <t2jhs7$ke$2@gioia.aioe.org>
 <t2jirv$i83$1@dont-email.me> <slrnt514de.175.sc@scarpet42p.localdomain>
 <t2rn6i$bi6$1@dont-email.me> <t2seor$19s1$1@gioia.aioe.org>
 <t2sfnl$h0i$1@dont-email.me> <slrnt53h59.1fu.sc@scarpet42p.localdomain>
 <t2trir$bpg$1@dont-email.me> <t2v12o$iub$1@ns507557.dodin.fr.nf>
 <20220410174507.06013648@coffee.novazur.fr>
 <t2vm5i$sco$1@ns507557.dodin.fr.nf>
 <20220411111453.1ad4d461@coffee.novazur.fr>
 <t32a3p$lsi$1@ns507557.dodin.fr.nf> <t33bej$25kp$1@news.gegeweb.eu>
 <t33fnk$gkk$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 12 Apr 2022 10:36:51 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b61b3ea3a51cfd06f7ae5e17d9f4e83c";
	logging-data="23934"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/0b9bZXlrfHMR8XrtniWNS"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:xPpo22dlCAyNWIobExp/gfy7dBI=
Bytes: 2574

Le 12-04-2022, Ghost-Raider a écrit :
[...]
> - la commande grep permet-elle l'utilisation des opérateurs logiques : 
> AND, OR, XOR ?

Grep utilise les expressions régulières, OR est facile :

 grep 'GR\|PC' fichier.txt

mais pour AND, c'est plus tordu :

 grep -E 'GR.*PC|PC.*GR'

et il y a six cas pour le double AND.


a XOR b = ( a AND NOT b ) OR ( NOT a AND b ) # l'un mais pas l'autre
      	= ( a OR b ) AND NOT ( a AND b )     # ou mais pas et

c'est déjà moche --- grep offre l'option négative -v, mais il faudra
cascader deux grep.


Il y a Awk, ... mais Sed peut le faire, de manière plutôt illisible ;)