The first one I'm going to publish is a Wikipedia search script, requiring only "dig" and "sed" programs. Usage is fairly simple, just type:
$ ./wiki.sh hello world
The script automatically replaces all spaces with underscores. And now the actual code:
#!/bin/ash
if [ ! -n "$1" ]
then
echo "What are you searching for?"
echo "Usage:"
echo " $0 keyword"
exit 1
fi
q=`echo $* | sed 's/\ /\_/g'`
dig +short txt $q.wp.dg.cx | sed 's/\"\ \"//'
exit 0
No comments:
Post a Comment