A Perl 'grep'
Practise with this:
#!/usr/bin/perl -n BEGIN { $pattern = shift; } print if(/$pattern/o);