5747032 [rkeene@sledge /home/rkeene/projects/scripts]$ cat -n borg.sh
1 #!/bin/bash
2 
3 function getquote () { for i in $*; do lynx -dump http://bash.org/?${i} | sed s/'|'/'<PIPE_GOES_HERE>'/g | tr "\n" "|" |
	sed s/'|References|.*'//g | tr '|' "\n" | sed -e s/'<PIPE_GOES_HERE>'/'|'/g -e s/'^.*\[[0-9]*\]#'/'----
	http:\/\/bash.org\/?'/ -e s/'\[[0-9]*\][+]([0-9-]*)\[[0-9]*\]- \[[0-9]*\]\[X\]'/'----'/ | grep -v '\[[0-9]*\]' | grep
	-v "^ *$" | grep -v "^ *[0-9]* quotes approved; [0-9]* quotes pending; [0-9]* marked"; done }
4 if [ -z "$1" ]; then set -- random; fi
5 TOHTML=cat; if [ "$1" = "-h" ]; then TOHTML="sed -e s/&/\\&amp;/g -e s/</\\&lt;/g -e s/>/\\&gt;/g"; shift; fi
6 if [ "$1" = "-r" ]; then getquote random | sed s/'|'/'<PIPE_GOES_HERE>'/g | tr "\n" '|' | sed s/'|---- #[0-9]*
	----|.*$'// | tr '|' "\n" | sed s/'<PIPE_GOES_HERE>'/'|'/g | ${TOHTML}; echo; else for i in $*; do getquote ${i}; done
	| ${TOHTML}; fi
5747033 [rkeene@sledge /home/rkeene/projects/scripts]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2004-09-24 07:30:55