slitaz-tools rev 238

man move to /etc/profile
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 16 09:50:09 2008 +0000 (2008-07-16)
parents 32a9f95084b7
children 89e25eb2ed4b
files tinyutils/man
line diff
     1.1 --- a/tinyutils/man	Wed Jul 16 09:17:27 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,29 +0,0 @@
     1.4 -#!/bin/sh
     1.5 -
     1.6 -case "$1" in
     1.7 -''|-*)
     1.8 -	cat <<EOT
     1.9 -Usage: man [section] command
    1.10 -EOT
    1.11 -	exit 1;;
    1.12 -esac
    1.13 -SECTION=all
    1.14 -MSG=""
    1.15 -if [ -n "$2" ]; then
    1.16 -	SECTION=$1
    1.17 -	MSG=" in section $SECTION"
    1.18 -	shift
    1.19 -fi
    1.20 -TOPIC=$1
    1.21 -if [ -f /usr/share/doc/$TOPIC/$TOPIC.html ]; then
    1.22 -	retawq --dump=file:///usr/share/doc/$TOPIC/$TOPIC.html | less -M
    1.23 -	exit 0
    1.24 -fi
    1.25 -#http://www.penguin-soft.com/penguin/man?q=$TOPIC&section=ALL&action=man
    1.26 -#http://linuxreviews.org/man/$TOPIC/index.html.en
    1.27 -#http://www.mediacollege.com/cgi-bin/man/page.cgi?topic=$TOPIC
    1.28 -#http://www.linuxcertif.com/man/$SECTION/$TOPIC/
    1.29 -#http://casper.ict.hen.nl/cgi-bin/man2html?+$TOPIC+$SECTION
    1.30 -wget -O - "http://man.he.net/?topic=$TOPIC&section=$SECTION" 2> /dev/null | \
    1.31 -awk "BEGIN { s=0; n=0 } /<PRE>/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"No manual entry for $TOPIC$MSG\" }" | \
    1.32 -sed -e 's/<[^>]*>//g' -e 's/&lt;/</g' -e 's/&gt;/>/g' -e 's/&amp;/\&/g' | less -M