# HG changeset patch # User Pascal Bellard # Date 1216201748 0 # Node ID a2a099ded78bb28a67e85dbe57cecda04f2c1da1 # Parent d9469dd5238d067b00107be406aeb704bdcf6b8d add default man command in /etc/profile diff -r d9469dd5238d -r a2a099ded78b rootfs/etc/profile --- a/rootfs/etc/profile Tue Jun 24 09:27:49 2008 +0000 +++ b/rootfs/etc/profile Wed Jul 16 09:49:08 2008 +0000 @@ -24,6 +24,52 @@ # which ldd > /dev/null || alias ldd='/lib/ld*.so --list' +# man fake +# +if [ ! -x /usr/bin/man ]; then + +man() +{ +local i +local SECTION +local MSG +local TOPIC +local MAN_SECTION +case "$1" in +''|-*) + cat </dev/null)|less -M + return + fi +done +wget -O - "http://man.he.net/?topic=$TOPIC§ion=$SECTION" 2> /dev/null | \ + awk "BEGIN { s=0; n=0 } /
/ { s=1 } { if (s) { print; n++} } /<\/PRE>/ { s=0 } END { if (n == 0) print \"No manual entry for $TOPIC$MSG\" }" | \
+	sed -e 's/<[^>]*>//g' -e 's/<//g' -e 's/&/\&/g' | less -M
+}
+
+fi
+
+
 # Export all variables definied above and set mask.
 #
 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING ignoreeof