#!/bin/bash
firefox “http://en.wikipedia.org/wiki/$1″chmod +x wikiwiki Vodka#!/bin/bash
firefox "http://www.rottentomatoes.com/search/full_search.php?search=$1"
#!/bin/bash
query=""
for this_query_term in $@
do
query="${query}${this_query_term}+"
done
url="http://www.rottentomatoes.com/search/full_search.php?search=${query}"
open "$url"
#!/bin/bash
args="$*"
echo ${args// /+}
function goo { open "http://www.google.com/search?q=`perl -MURI::Escape -e \"print uri_escape(\\"$1\\")\"`&hl=en" ; }
[you@yourhost]$ goo "if (flag1 && flag2)"
http://www.google.com/search?q=if%20(flag1%20%26%26%20flag2)&hl=en
open command, which will open the URL in your default browser.
#!/bin/bash
function chr {
printf -v chr \\\\%o $1
printf -v chr $chr
}
function asc {
local arg="${1:0:1}"
local -i upper=256
local -i lower=0
until
let asc=(upper+lower)/2
chr $asc
[ "$chr" == "$arg" ]
do
if [ "$chr" '>' "$arg" ]
then
let upper=asc
else
let lower=asc
fi
done
}
function url_escape {
local c
url_escape=''
for ((i=0; i<${#1}; i++))
do
c="${1:$i:1}"
[[ "$c" =~ '[-!$'\''()*+,.0-9A-Z_a-z]' ]] || {
asc "$c"
printf -v c %%%02X $asc
}
url_escape="$url_escape$c"
done
}
function google_search {
url_escape "$1"
open "http://www.google.com/search?q=$url_escape&hl=en"
}
IFS=+
google_search "$*"
goo penguin will generateopen "http://www.google.com/search?q=penguin&hl=en",goo penguin cafe orchestra will get youopen "http://www.google.com/search?q=penguin+cafe+orchestra&hl=en", goo 'penguin cafe orchestra' runsopen "http://www.google.com/search?q=penguin%20cafe%20orchestra&hl=en",goo \"penguin cafe orchestra\" yieldsopen "http://www.google.com/search?q=%22penguin+cafe+orchestra%22&hl=en", andgoo '"penguin cafe orchestra"' makesopen "http://www.google.com/search?q=%22penguin%20cafe%20orchestra%22&hl=en".
posted by ardgedee at 8:44 PM on February 19, 2007