March 9, 2005
Quick Scripts and CLI Enhancements
I've been spending more and more time in terminal since I often want a more powerful way to do things. As such I've been modifying my environment and creating tools for the CLI that help me work faster and more efficiently.
I'm going to post a few of these scripts and environment tweaks here over the next few days. Here's a new one that I just whipped together to search all the directories in my $MANPATH for a keyword or just list everything if run with no arguments.
#!/usr/bin/perl -w # # listman.pl my @mans = split ':', $ENV{MANPATH}; if (@ARGV) { my $keyword = shift; system("ls -R @mans | grep -i $keyword"); } else { system("ls -R @mans"); } |
This is what it looks like when you run it:
$ listman.pl html mkhtmlindex.1 HTML::Entities.3pm HTML::Filter.3pm HTML::HeadParser.3pm HTML::LinkExtor.3pm HTML::Parser.3pm HTML::PullParser.3pm HTML::TokeParser.3pm grohtml.1 headerdoc2html.1 pod2html.1 texi2html.1 Pod::Html.3pm |
Posted by joshua at March 9, 2005 11:20 AM
Post a comment