Insert variable after command in script

0

Randomly browsing the site I found this question/answer:

Run Safari from terminal with given URL address without open command User adds:

I know, I could do it using open:

open -a safari http://www.example.com

The answer:

/Applications/Safari.app/Contents/MacOS/Safari & sleep 1 && osascript -e 'tell application "Safari" to open location "http://www.google.com"'

Elaborating on that, how could I insert the location on a variable to run it from $PATH everywhere something like goto scheme://site.com (or search query, if allowed). Like the original user, I also know I could do it using open but I want to learn a little something. :)

I've been using scripts here and there for repetitive tasks; when it comes to variables I can only do simple read and they have to be in the right order or everything goes south quickly. I don't think it works non-interactive anyway.

Thanks!

Vita

Posted 2019-05-28T00:30:55.463

Reputation: 3

No answers