bash - How to use flag with 'sed' on mac? -


i dont find way use flag sed , matching pattern.

i'm trying flag. don't understand how works.

$ sed -i '' -n '/xxx.xxx@xxx.fr/i d' res.txt sed: 1: "/xxx.xxx@xxx.fr/i d": command expects \ followed text 

so want match xxx.xxx@xxx.fr , xxx.xxx@xxx.fr

the -i '' --in-file (without cache) d delete.

so how can use flag , multiple of them ? in documentation i've found way seems not work @ all.

i use perl - regexes , options far more orthogonal , consistent sed versions across platforms:

perl -i -ne '/xxx.xxx.fr/i || print' res.txt 
  • -i means "in-place" editing
  • -n means execute loop around input lines awk or sed
  • -e means execute following script

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -