Bash script opening application

In this tutorial, I have written a small program opening application by the shell script. Linux the essential for DevOps Roles.
I will create the directory and create a file openapp. Let’s begin!

[huupv@huupv devopsroles]$ mkdir myall && cd $_
[huupv@huupv myall]$ pwd
[huupv@huupv myall]$ touch openapp

Bash script opening application


if [ $1 = "fb" ]; then
  echo Opening facebook
  python -m webbrowser -t ""
elif [ $1 = "web" ]; then
  echo Opening My Website 
  python -m webbrowser -t ""
  python -m webbrowser -t ""
elif [ $1 = "youtube" ]; then
  echo Opening youtube
  python -m webbrowser -t ""

Add permission to execute.

[huupv@huupv myall]$ chmod +x openapp

Now, I opening Youtube with my shell script.

[huupv@huupv myall]$ ./openapp youtube

The screen output terminal as below

Bash script opening application


Thought the article, How to use Bash script opening application as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.