Shell script to open a URL

后端 未结 6 1051
既然无缘
既然无缘 2021-02-01 13:51

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

6条回答
  •  [愿得一人]
    2021-02-01 14:52

    If you want a cross-OS solution and are comfortable using Python (3):

    Try this:

    import webbrowser
    
    webbrowser.open('https://yoururl.com')
    

    Or in a terminal/cmd:

    python -m webbrowser -t "https://yoururl.com"
    

提交回复
热议问题