Liste des Groupes | Revenir à col misc |
Besides the traditional “Useless Use Of Cat” (UUOC) newbie faux pas,Tut Tut!
we can add “Useless Use Of Regexes”.
These can often be quite subtle. I spotted one obvious instance here
<https://www.zdnet.com/article/5-ways-i-use-regex-in-linux-and-why-theyre-so-essential/>,
namely this one:
ip addr | grep -Eo '192\.168\.1\.[0-9]{1,3}'
which can be more easily written using features built into iproute2 itself:Seriously, though, it is often easier to filter output from a standard command with grep, than it is to learn all the command flags.
ip addr show to 192.168.1.0/24
Les messages affichés proviennent d'usenet.