#!/usr/bin/env perl
#
# possible options:
#  omit header line
#  omit self from listing
#  no metacharacters

use strict;
use warnings;
use utf8;
use File::Basename qw(basename);

my $cmd_name = basename($0);
my $pat      = shift or die "Usage: $cmd_name pattern\n";
open PS, "ps -axww |"
  or die "Couldn't run ps: $!; aborting";

print scalar <PS>;    # header
while (<PS>) {
    print if /$pat/o;
}
