sed -i 's/.*(?=http-proxy-(exceptions|host|port))/# /' /path/to/file
Perl to the rescue, where PCRE with full look around is possible, the above command turns to the following one-liner:
perl -i -pe 's/.*(?=http-proxy-(exceptions|host|port))/# /' /path/to/file ... which works like a charm.
0 Kommentare:
Kommentar veröffentlichen