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 /home/huupv/devopsroles/myall [huupv@huupv myall]$ touch openapp
Bash script opening application
#!/bin/bash if [ $1 = "fb" ]; then echo Opening facebook python -m webbrowser -t "https://www.facebook.com/" elif [ $1 = "web" ]; then echo Opening My Website python -m webbrowser -t "https://www.devopsroles.com/" python -m webbrowser -t "https://www.huuphan.com/" elif [ $1 = "youtube" ]; then echo Opening youtube python -m webbrowser -t "https://www.youtube.com/user/SystemOperatinglinux" fi
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
Conclusion
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!