Last active
November 6, 2015 05:05
-
-
Save hackugyo/0aa835bdd33ec1ba5118 to your computer and use it in GitHub Desktop.
Google:未指定キーワードを発生させずに検索する
This file contains hidden or 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
| # usage: | |
| # $ gsearch your query | |
| # => Google '"your" "query"' | |
| gsearch () | |
| { | |
| ( argv=("$@"); | |
| # arr=$(for v in "${argv[@]}"; do echo "$v"; done); \ | |
| arr=$(for v in "${argv[@]}"; do echo "\"$v\""; done); | |
| str="$(IFS=" "; echo "${arr[*]}")"; | |
| open https://www.google.co.jp/search?q="$str" ) | |
| # サブシェルを使う(カッコで全体を囲む)ことでbashrcに記述しても変数を汚さないようにしてある | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment