This short snippet searches the current path for commands that
contain the argument (that can be a regular expression)
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;
}
}