Monday, March 31, 2014

Writing Hello World Program in Bash

Go To Terminal ,open your text editor in my case I am using Kwrite on fedora kde.
Gedit from Gnome will also work instead of Kwrite.

Kwrite /home/sangram/Bash/

Now your text editor will open add Following code in it and save.

# My first script
echo "Hello World!"

Now close your text editor.

On Terminal change your directory to directory holding your

One can cross verify in which directory currently he is working my issuing

pwd” command.”pwd” command stand for present working directory.

To able to run our shell script just created we need to change permissions of file hence

Kwrite /home/sangram/Bash/

Now we are ready to run our first shell script,To run your script write following command on Terminal.



[sangram@localhost Bash]$ bash
Hello World!
[sangram@localhost Bash]$ s

No comments:

Post a Comment