Simple really... Just type up something along the lines of:
echo "Hello world!..."
echo "Second line"
save it in a file, let's say, myfirst.sh
The extension is not necessary at all, but seems to be the tradition. Now go the same directory where myfirst.sh is located through terminal. (If you don't know how to navigate to that directory by unix commands, you probably should learn a bit more about UNIX first.) Next step is to type:
chmod 744 myfirst.sh
which will make that script executable. (You can check it with
ls -l myfirst.sh
command. If you see something like -rwxr--r-- in the same line as myfirst.sh, you are good to go. The first "x" stands for executable by you.) Now, when you type
myfirst.sh
at your command prompt, it will execute the script. However, if you don't include the directory where this script resides into your path, you can only run it when you are already inside that directory. Oh, the disclaimer: do all of these steps on your own risk (no warranties implied or otherwise.) This is just my personal opinion of how this could be done.
