Posted By

ksaver on 02/27/11


Tagged

DNS dig wikipedia


Versions (?)

wikish.sh


 / Published in: Bash
 

URL: http://www.commandlinefu.com/commands/view/7772/query-wikipedia-via-console-over-dns

  1. #! /usr/bin/env bash
  2. # wikish.sh
  3. # Query Wikipedia via console over DNS.
  4. # Reproduced without author's permission.
  5. # From commandlinefu.com:
  6. # http://www.commandlinefu.com/commands/view/7772/query-wikipedia-via-console-over-dns
  7.  
  8. scriptname=$(basename $0)
  9.  
  10. if [ -z "$1" ]
  11. then
  12. echo -e "\tSyntax: $scriptname <Keywords>"
  13. echo -e "\tExampl: $scriptname 'bash shell'"
  14. exit
  15. else
  16. keyword=$(echo $*|tr ' ' '_')
  17. dig +short txt $keyword.wp.dg.cx
  18. fi

Report this snippet  

You need to login to post a comment.