* Handy script offering
@ 2001-07-20 2:35 Steve Jorgensen
2001-07-24 10:18 ` David A. Cobb
0 siblings, 1 reply; 2+ messages in thread
From: Steve Jorgensen @ 2001-07-20 2:35 UTC (permalink / raw)
To: cygwin@cygwin. Com (E-mail)
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Handy script offering
2001-07-20 2:35 Handy script offering Steve Jorgensen
@ 2001-07-24 10:18 ` David A. Cobb
0 siblings, 0 replies; 2+ messages in thread
From: David A. Cobb @ 2001-07-24 10:18 UTC (permalink / raw)
To: jorgens, cygwin@cygwin. Com (E-mail)
At 7/20/01 05:44 AM (Friday), Steve Jorgensen wrote:
>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".
Little do I know, but would it not make sense that
if "awk" => "gawk" then "awk.1" => "gawk.1" etc.
(IOW, symlink the man pages.)
David A. Cobb, Software Engineer, Public Access Advocate, All around nice guy.
Get my PGP key at
:< http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=superbiskit >
Fingerprint=0x{6E3E_DB8C_2E8C_4248_62B2_FE29_08EE_CF0A_3629_E954}
:< http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=superbiskit&fingerprint=on >
"By God's Grace I am a Christian man, by my actions a great sinner."
--The Way of a Pilgrim, R. M. French [tr.]
Potentially Viral Software is any software for which you are not allowed
to examine the source. Do not buy or use Potentially Viral Software!
<---.----!----.----!----.----!----.----!----.----!----.----!----.---->
--
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-24 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20 2:35 Handy script offering Steve Jorgensen
2001-07-24 10:18 ` David A. Cobb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).