Bash Script Tutorial
Posted by
tollyrocks
on Tuesday, February 16, 2010
Lets begin this bash scripting tutorial with a simple "Hello World" script. Let's start with Learning the bash Shell: Unix Shell Programming
1. Hello World Bash Shell Script
Open vi hello_world.sh
#!/bin/bash
# declare STRING variable
STRING="Hello World"
#print variable on a screen
echo $STRING
escape Colon :wq w:- save, q:- quit.
Navigate to a directory where your hello_world.sh is located and make the file executable:
$ chmod +x hello_world.sh
Execute the Script.
$ ./hello_world.sh
0 comments:
Post a Comment