Skip to content

Instantly share code, notes, and snippets.

@wx13
Created July 7, 2010 18:36
Show Gist options
  • Save wx13/467070 to your computer and use it in GitHub Desktop.
Save wx13/467070 to your computer and use it in GitHub Desktop.
script to find man pages on the web
#!/bin/bash
tmpfile=/tmp/wman.$RANDOM
cmd=$1
for n in $(seq 1 8)
do
w3m -dump http://linux.die.net/man/${n}/${cmd} > $tmpfile
answ=$(head -n1 $tmpfile)
if [ "${answ}" != "Not Found" ]
then
less -S $tmpfile
break
fi
done
rm $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment