Bash to Basics: Print Text with echo
In the first installment of Command Line Basics, I explained the use of the echo command. In this first installment of Bash to Basics, I'll show how to use the echo command in a script.
Open up a text editor and paste the following text into it.
# This is a demonstration of the echo command
echo Hello World!
echo This is my first bash program.
Save it as a file called hello1 and exit the text editor.
We now need to make the file executable using the chmod command.
You can now run the script program with the command
Your output should look like
This is my first bash program.
Congratulations! You just wrote a shell script.