Posted By

noah on 11/08/08


http rails commandline rake one-liners

Versions (?)

Rake routes filtering with Perl

 / Published in: Perl


  1. rake routes > routes.txt
  2. perl -ne 'm{(.* GET)(.*)}; print qq{$1 $2\n} if $1' routes.txt
  3. perl -ne 'm#(?:GET\s+| {7})(/[^\s]+)#; print qq{$1\n} if $1' routes.txt
  4. perl -ne 'm#^\s+(.*)(GET\s+| {7})(/[^\s:.]+)#; print qq{$1 $2 $3\n} if $2' routes.txt
  5. perl -ne 'm#^\s+(.*)(GET\s+| {7})(/[^\s.]+)#; print qq{$3\n} if $2' routes.txt

Report this snippet  

You need to login to post a comment.