/ Published in: Perl
URL: http://www.reddit.com/r/perl/comments/rr1gs/need_to_use_perl_e_to_search_for_string_and/c47y0au
-n means loop over the lines of all file names given on the command line, or standard input if none were given. -E is a version of -e that enables newer features like say, which is the same as print but adds a newline.
Expand |
Embed | Plain Text
perl -nE 's/\s+$//, say if /foo/' input.txt
You need to login to post a comment.
