Created
February 4, 2019 09:44
-
-
Save juanirming/cc594818e5bf2d7c99a040d9cd822117 to your computer and use it in GitHub Desktop.
Search Google and Wikipedia from bash command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################################################################################ | |
# bash_web_search.sh | |
# | |
# The functions below can be included in .bashrc (or other start-up file) to | |
# provide the ability to perform Google (via Startpage) and Wikipedia searches | |
# directly from the command line using the commands se and wi. | |
# | |
# Examples: se are cats smarter than dogs | |
# wi felis catus | |
# | |
# Dependencies: elinks | |
# | |
# Author: Juan Irming | |
function se() { | |
IFS='+' | |
elinks "https://www.startpage.com/do/search?query=$*" | |
} | |
function wi() { | |
IFS='_' | |
elinks "https://en.wikipedia.org/wiki/$*" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment