How do I write a simple shell script (say script.sh), so that I can pass a URL as an argument while executing?
I want a browser to start with the page opened on that URL
For Windows,
You can just write start filename_or_URL
start https://www.google.com
It will open the URL in a default browser. If you want to specify the browser you can write:
start chrome https://www.google.com
start firefox https://www.google.com
start iexplore https://www.google.com
Note: The browser name above can be obtained from the exe
file found in program files (sample: C:\Program Files\Internet Explorer\iexplore.exe
) if you wish to open multiple URLs.
start chrome "www.google.com" "www.bing.com"
It was tested with .sh (shellscript file) and .bat files.