safari.sh
----> simply open Safarisafari.sh --url URL_PARAM
----> open a tab in Safari with the site specified in URL_PARAMsafari.sh YOUR_QUERY_SEPARATED_BY_SPACE
----> open Safari and search "YOUR_QUERY_SEPARATED_BY_SPACE" on Google (NOTE: if your query contains symbols which are Shell operators (e.g.(
,)
,&
,'
,>
), you should put it in quotes as you can see in example usage 3.ii)
safari.sh
----> open Safarisafari.sh --url www.github.com
----> open https://www.github.com on Safari-
safari.sh something to search on Google
----> find "something to search on Google" on Googlesafari.sh "Where there's a will there's a way (proverb)"
----> find "Where there's a will there's a way (proverb)" on Google
If you usually use another web browser on your Mac, you can easily adapt my script by changing BROWSER_PATH
variable with the correct web browser installation path. For example:
BROWSER_PATH="/Applications/Google Chrome.app"
BROWSER_PATH="/Applications/Firefox.app"
BROWSER_PATH="/Applications/Opera.app"
See https://github.com/antoniolanza1996/scripts_and_dotfiles/tree/main/bash_scripts for other useful bash scripts for MacOS.