How to create a Shell Script & execute it in Linux/Unix?
How to create a Shell Script & execute it in Linux/Unix?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
{1} Open a text editor you want to write the script. It can be a command-line editor like vi.
{2} Add the following lines:
#!/bin/bash
echo "Hi Aviance user!"
{3} Save the file in the your workplace as “welcome.sh”.
{4} Move from the text editor to a command shell.
{5} From the command shell, type this to terminal:
$ chmod +x welcome.sh
{6} To execute the script, type this to terminal:
$ ./welcome.sh
OUTPUT: Hi Aviance user!