I like this construct for searching through files in a directory and pulling out part of a line.
Just add the regular expression. The '?' designates a non-greedy expression, which means the finite statement machine will quit on the first successful match.
find . -name "*.xml" | xargs perl -ne '/(.*?)"/; print $1; print "\n";'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment