Mail Archives: cygwin/2001/07/20/05:36:19
Ok, perhaps no one cares, but as one of the many 'nix newbies who start
playing with Cygwin, I scratched an itch that other newbies might have.
The problem is that when you type man <command>, but you enter the common
command name that all the books tell you about rather than the name of the
program that's a symlink to on Cygwin, there appears to be no manpage.
This one bit me, and I thought there was no man page for "awk" not
realizing I should be asking for "man gawk".
I wrote a perl script that solves the problem which is included below. It
would be very handy for other newbies to have this in the distribution and
mention it in the manual.
#!/bin/perl
if ( scalar @ARGV ne 1 ) {
print "\nUsage: metaman <command_name>\n\n";
print "this command displays the man page for the named program.\n";
print "If the name refers to a symbolic link to another program,\n";
print "the man page for that program is displayed.\n";
} else {
$found = `find \`which $ARGV[0] 2> /dev/null\` -printf \"%l\"`;
if ( $found =~ /([^\/]+)$/ ) {
$found = $1;
$found =~ s/.exe//;
system("man $found");
} else {
system("man $ARGV[0]");
}
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -