My First Bash Shell Script

May 25, 2014 | By | Reply More

I am currently learning bash shell script. This is not a tutorial since I am completely zero on shell script. I am interested to bash script because I often read and use many shell script on Linux. Now, I want to create my first Bash Shell Script. This script will print “Hello World” on screen. Here is the code:

#!/bin/bash
#Define String variable
TEXT=”Hello World”
#Print the Hello World on screen
echo $TEXT

Now close and save the script. And we must make the script executable.

chmod +x hello-world.sh

Now testing time :)

dhani@dhani-ubuntu:~/Documents$ ./hello-world.sh
Hello World
dhani@dhani-ubuntu:~/Documents$

Tags:

Category: Programming

Leave a Reply