Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <01C110C5.EEE26260.jorgens@coho.net> From: Steve Jorgensen Reply-To: "jorgens AT coho DOT net" To: "cygwin AT cygwin. Com (E-mail)" Subject: Handy script offering Date: Fri, 20 Jul 2001 02:44:32 -0700 X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 , 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 \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/