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
orsed
- -e means execute following script
Comments
Post a Comment