Deutsch   English   Français   Italiano  
<62556457$0$24256$426a34cc@news.free.fr>

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

Path: ...!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp1-1.free.fr!not-for-mail
Reply-To: thierry.houx@free.fr
Subject: Re: Configuration d'un super PC Linux pour Ghost "Michu" Raider -
 questions sur le langage de commande
Newsgroups: fr.comp.os.linux.configuration
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>
 <slrnt5ali3.51a.lhh+news-no_spam@hercule.home.arpa>
 <t33moh$4kn$2@dont-email.me>
From: Thierry Houx <thierry.houx_no_spam@free.fr>
Organization: Haute-Normandie.fr
Date: Tue, 12 Apr 2022 13:36:55 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.13.0
MIME-Version: 1.0
In-Reply-To: <t33moh$4kn$2@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: fr-FR
Content-Transfer-Encoding: 8bit
Lines: 35
Message-ID: <62556457$0$24256$426a34cc@news.free.fr>
NNTP-Posting-Date: 12 Apr 2022 13:36:55 CEST
NNTP-Posting-Host: 88.162.112.128
X-Trace: 1649763415 news-4.free.fr 24256 88.162.112.128:26032
X-Complaints-To: abuse@proxad.net
Bytes: 3217

Le 12/04/2022 à 13:11, Ghost-Raider a écrit :
> Le 12/04/2022 à 12:36, Jacques L'helgoualc'h a écrit :
>> 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 ;)
>>
> 
> OK, merci. Je note tous tes exemples, tu ne parles pas dans le vide.
> 
Awk et sed, oui mais si l'utilisation est récurrente, il faudra penser à 
écrire un script shell. Le code nécessaire avec ces outils peut être 
assez ésotérique et mieux vaut l'avoir disponible dans un format simple 
pour soi.