Earlier I recommended
perl -ne'if (s/.../.../) { print } else { print STDERR }' <access_log 2>out.err >out.csv
What I had in mind was
perl -ne'print { s/.../.../ ? STDOUT : STDERR } $_' <access_log 2>out.err >out.csv
It just occured to me that it can be shortened to
perl -pe'select s/.../.../ ? STDOUT : STDERR' <access_log 2>out.err >out.csv
In reply to Re: regexp matching bad stuff ...
by ikegami
in thread regexp matching bad stuff ...
by raiten
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |