#!/usr/bin/perl # # From w3m. # # Note that this script has licensing terms different from those of Chawan. # See /res/license.html#w3m for details. # # Usage: install perl, then look up man pages using: # # $ cha man:cha # view in any manual (man cha) # $ cha 'man:cha(1)' # view in a specific manual (man -s 1 cha) # $ cha man-k:cha # search in any manual (man -k cha) # $ cha 'man-k:cha(1)' # search in a specific manual (man -k cha -s 1) # # You may also use the `mancha` wrapper. $MAN = $ENV{'MANCHA_MAN'} || '/usr/bin/man'; $QUERY = $ENV{'QUERY_STRING'} || $ARGV[0]; $SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; $CGI = "man:"; $CGI2 = "file:"; # $CGI2 = "file:///\$LIB/hlink.cgi?"; $SQUEEZE = 1; $ENV{'PAGER'} = 'cat'; if ($QUERY =~ /^man-k:/) { $QUERY =~ s/^man-k://; my $keyword = &form_decode($QUERY); my $sectionopt = ""; if ($keyword =~ s/(.*)\((\w+)\)$//) { $keyword = $1; $sectionopt = "-s $2 "; } my $k = &html_quote($keyword); print < man $sectionopt-k $k

man $sectionopt-k $k