Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ 1 [2] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: man ls- Not Busybox?< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 19 2008,08:15 QUOTE

A *very* simplified man bash script for die.net:
Code Sample
[ -n "$1" ] && exec netrik "http://linux.die.net/man/$1"

It's probably not suitable for everyone, but it suits me =o)

I'd probably add an optional integer argument for specifying a man section, but didn't bother for the moment.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: June 25 2008,04:12 QUOTE

Found it was much more convenient to keep a local copy, so it now saves the html automatically.
Code Sample
manserver="http://linux.die.net/man"
mandir="/home/shared/reference/man_pages"

[ -n "$1" ] || exit
if [ ! -r "$mandir/$1.html" ]; then
 wget "$manserver/$1" -O "$mandir/$1.html"
fi
exec netrik "$mandir/$1.html"


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: June 25 2008,06:40 QUOTE

Barry Kauler has a nice script that first searches for txt or htm* files in /usr/share/doc directory before going online:

#!/bin/sh
#Barry Kauler 2006. written for puppyos, www.puppyos.com
#a script to replace the man command.

# -iname option is case-insensitive, -name is case-sensitive.

BBAPPLETS="|addgroup|adduser|adjtimex|ar|arping|ash|awk|basename|bunzip2|busybox|bzcat|cal|cat|chgrp|chmod|chown|chroot|chvt|clear|cmp|cp|cpio|crond|crontab|cut|date|dc|dd|deallocvt|delgroup|deluser|devfsd|df|dirname|dmesg|dos2unix|dpkg|dpkg-deb|du|dumpkmap|dumpleases|echo|egrep|env|expr|false|fbset|fdflush|fdformat|fdisk|fgrep|find|fold|free|freeramdisk|fsck.minix|ftpget|ftpput|getopt|getty|grep|gunzip|gzip|halt|hdparm|head|hexdump|hostid|hostname|httpd|hush|hwclock|id|ifconfig|ifdown|ifup|inetd|init|insmod|install|ip|ipaddr|ipcalc|iplink|iproute|iptunnel|kill|killall|klogd|lash|last|length|linuxrc|ln|loadfont|loadkmap|logger|login|logname|logread|losetup|ls|lsmod|makedevs|md5sum|mesg|mkdir|mkfifo|mkfs.minix|mknod|mkswap|mktemp|modprobe|more|mount|msh|mt|mv|nameif|nc|netstat|nslookup|od|openvt|passwd|patch|pidof|ping|ping6|pipe_progress|pivot_root|poweroff|printf|ps|pwd|rdate|readlink|realpath|reboot|renice|reset|rm|rmdir|rmmod|route|rpm|rpm2cpio|run-parts|rx|sed|seq|setkeycodes|sha1sum|sleep|sort|start-stop-daemon|strings|stty|su|sulogin|swapoff|swapon|sync|sysctl|syslogd|tail|tar|tee|telnet|telnetd|test|tftp|time|top|touch|tr|traceroute|true|tty|udhcpc|udhcpd|umount|uname|uncompress|uniq|unix2dos|unzip|uptime|usleep|uudecode|uuencode|vconfig|vi|vlock|watch|watchdog|wc|wget|which|who|whoami|xargs|yes|zcat|"

SYMLNKS="`find /usr/share/doc -maxdepth 1 -type l | tr "\n" " "`"

FNDTXT="`find /usr/share/doc -maxdepth 3 -mount -xtype f -iname ${1}.txt`"
#find does not follow symlinks in paths unless followed by at least a "/", need this crap...
if [ "$FNDTXT" = "" ];then
for ONELNK in $SYMLNKS
do
 [ ! "`echo -n "$ONELNK" | grep -i "${1}.txt$"`" = "" ] && FNDTXT="$ONELNK"
 [ ! "$FNDTXT" = "" ] && break
 FNDTXT="`find ${ONELNK}/  -mount -maxdepth 3 -xtype f -iname ${1}.txt`"
 [ ! "$FNDTXT" = "" ] && break
done
fi
if [ "$FNDTXT" != "" ];then
exec defaulttextviewer "$FNDTXT"
else
FNDHTM="`find /usr/share/doc -maxdepth 9 -mount -xtype f -iname ${1}.htm*`"
#v2.12 improved find code contributed by Dougal...
if [ "$FNDHTM" = "" ];then
  FNDDIR="`find /usr/share/doc -maxdepth 9 -mount -type d -iname ${1}*`"
  [ $? -eq 0 ] && [ -f $FNDDIR/index.html ] && FNDHTM=$FNDDIR/index.html
fi
#find does not follow symlinks in paths unless followed by at least a "/", need this crap...
if [ "$FNDHTM" = "" ];then
 for ONELNK in $SYMLNKS
 do
  [ ! "`echo -n "$ONELNK" | grep -i "${1}.htm"`" = "" ] && FNDHTM="$ONELNK"
  [ ! "$FNDHTM" = "" ] && break
  FNDHTM="`find ${ONELNK}/ -mount -maxdepth 3 -xtype f -iname ${1}.htm*`"
  [ ! "$FNDHTM" = "" ] && break
 done
fi

if [ ! "$FNDHTM" = "" ];then
 [ "`echo -n "$FNDHTM" | cut -b 1`" = "/" ] && FNDHTM=file://$FNDHTM
 exec defaulthtmlviewer "$FNDHTM"
else

 #v2.21 #maybe it is a busybox applet...
 #if [ ! "`echo -n "$BBAPPLETS" | grep "|${1}|"`" = "" ];then
 # exec defaulthtmlviewer file:///usr/share/doc/busybox.htm
 #else
 # exec defaulthtmlviewer file:///usr/share/doc/index.html
 #fi
 #exec defaulthtmlviewer http://en.wikipedia.org/wiki/${1}
 #exec defaulthtmlviewer http://unixhelp.ed.ac.uk/CGI/man-cgi?${1}
 #exec defaulthtmlviewer http://threads.seas.gwu.edu/cgi-bin/man2web?program=${1}
 exec defaulthtmlviewer http://linux.die.net/man/${1}
 
fi

fi
Back to top
Profile PM 
7 replies since May 17 2008,09:47 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ 1 [2] >/
reply to topic new topic new poll
Quick Reply: man ls- Not Busybox?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code