Hallo in die Runde,
Ich habe das gelesen grep und auch Erklärung regulärer Ausdrücke.
Was mache ich falsch?
Das funktioniert:
mate@mate-HP:~$ cat /etc/fstab | grep -v "#" UUID=7c98e1e6-4163-40b5-b890-b20abb244f33 / ext4 errors=remount-ro 0 1 UUID=dad2ef8b-91d7-4705-8d02-762814e2a0c0 /home ext4 defaults 0 2 UUID=779a5b91-5f21-4e66-9a8f-5df952a18f81 none swap sw 0 0 mate@mate-HP:~$
Alle Kommentarzeilen werden ausgeblendet.
Das funktioniert nicht:
mate@mate-HP:~$ lsusb -v | grep -v Couldn\'t\ open\ device\,\ some\ information\ will\ be\ missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing ...
in der langen Form:
lsusb -v | grep --invert-match --regexp=Couldn\'t\ open\ device\,\ some\ information\ will\ be\ missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing ...
auch das nicht:
mate@mate-HP:~$ lsusb -v | grep --invert-match --regexp="Couldn\'t\ open\ device\,\ some\ information\ will\ be\ missing" Couldn't open device, some information will be missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing ...
jedoch das im Zusammenhang mit -i sehr wohl.
mate@mate-HP:~$ lsusb -v | grep -i "Couldn" Couldn't open device, some information will be missing Couldn't open device, some information will be missing Couldn't open device, some information will be missing ...
Sind Blank, ' und Komma so richtig berücksichtigt, so wie ich RegExp auslege oder wo liegt der Hase im Pfeffer?
Bearbeitet von ChickenLipsRfun2eat:
Fehler im Titel korrigiert.