Created
February 8, 2020 14:19
-
-
Save minimul/5d666e7d9d648b7d2b01f55fbf93231f to your computer and use it in GitHub Desktop.
Elinks smart URL for w3m in bash functions
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
function go-base { | |
url=$1 | |
echo $url | |
shift | |
args=$@ | |
params="$(ruby -r cgi -e 'puts CGI.escape(ARGV[0])' "$args")" | |
url=$(printf $url "$params") | |
cmd="w3m \"$url\"" | |
eval $cmd | |
} | |
function go-th { | |
go-base "https://words.bighugelabs.com/%s" $@ | |
} | |
function go-l { | |
go-base "https://www.google.com/search?btnI&q=%s" $@ | |
} | |
function go-g { | |
go-base "https://www.google.com/search?q=%s" $@ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment