Deutsch   English   Français   Italiano  
<65958156$0$7754$426a74cc@news.free.fr>

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

Path: ...!news.mixmin.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-b.proxad.net!nnrp3-1.free.fr!not-for-mail
From: yves <yves@free.invalid>
Subject: grep - remplacer une succession de pipes
Newsgroups: fr.comp.lang.regexp
MIME-Version: 1.0
User-Agent: Pan/0.149 (Bellevue; 4c157ba)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Date: 03 Jan 2024 15:46:30 GMT
Lines: 72
Message-ID: <65958156$0$7754$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 03 Jan 2024 16:46:30 CET
NNTP-Posting-Host: 37.67.154.156
X-Trace: 1704296790 news-2.free.fr 7754 37.67.154.156:62626
X-Complaints-To: abuse@proxad.net
Bytes: 2154

Bonjour (et bonne année).

sous ubuntu /usr/share/dict/french est un fichier de 346200 lignes
installé par le paquet wfrench

#+begin_src sh :results output
apt-cache search wfrench |grep -v forensics
wc -l /usr/share/dict/french
#+end_src

#+RESULTS:
: wfrench - dictionnaire de mots français pour /usr/share/dict
: 346200 /usr/share/dict/french

-----------------------

Cette commande :

#+begin_src sh
grep -vc [abcdef] /usr/share/dict/french
#+end_src

#+RESULTS:
: 6904

retourne le nombre (option -c) de lignes qui ne contiennent (option
-v) ni a ni b ni c ni de ni e ni f

-----------------------

Cette commande :

#+begin_src sh
grep -vc [a-s]  /usr/share/dict/french
#+end_src

#+RESULTS:
: 18

retourne le nombre de lignes qui ne contiennent aucune des lettres de
a à s

---------------------

Cette commande :

#+begin_src sh 
cat /usr/share/dict/french|grep a|grep b |grep c| grep d|grep e|grep  f
#+end_src

#+RESULTS:
| acidifiable     |
| déchiffrable    |
| déchiffrables   |
| défrichable     |
| différenciable  |
| différenciables |
| fécondable      |
| indéchiffrable  |
| indéchiffrables |
| indéfrichable   |
| indéfrichables  |

retourne les (11) lignes qui contiennent à la fois a et b et c et d et
e et f

Existe-t-il une syntaxe qui évite cette succession de pipes ( |grep
a|grep b| grep c ....etc...) ?

@+
-- 
Yves