This is a two-minute effort that helped me find out that redhat ships with 'gcolorsel' which replaces the old 'xcolors'.
(Now cleaned and documented for your viewing pleasure)
#!/usr/bin/perl # Lists commands on the path that contain the given regular expression +. # # USAGE: # comgrep.pl <regular expression> my $pat=shift || ""; my %printed; foreach my $p (split ":",$ENV{PATH}) { foreach (glob "$p/*") { next unless -X && -f; s|//|/|g; my ($path, $name)= m|(.*)\/([^/]*)|; print "$_\n" if $name=~m/$pat/o and !$printed{$_}; $printed{$_}=1; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Command Grep
by bwana147 (Pilgrim) on Aug 29, 2001 at 15:01 UTC | |
by fundflow (Chaplain) on Aug 29, 2001 at 19:58 UTC | |
Re: Command Grep
by trizen (Hermit) on Dec 08, 2011 at 00:55 UTC |