Tutorial: Bourne Shell
From ours Linux distribution, who are our operating system for administrate and for office automation. We can now using the Terminal for run a commands or run programms (bin/, sbin/, ...)
Bourne Shell or SH, in fact is a former version of Bourne Again Shell or Bash for manage from the "Terminal" ours LINUX distribution.
Well, it is a "mini - game" who is our programm here.
So, move on "Desktop" and coding this programm in a Editor of text as nano, vi or other programm (editor of code, IDE,...).
You must of using a good rules for that a programm works. A good syntax or a good grammar of programmation (does in fact the formating to text of your code page) .
Here, the source code Bourne Shell who is interresting for LINUX:
#!/bin/sh
#Filename: PushGameDemo.sh
echo "\e[1;36m ///////PLAYER//////NAME : \e[0m";
read name;
echo "\e[1;36m NAME du PLAYER: $name \e[0m";
echo "\e[1;36m ///////PLAYER//////OLD YEARS : \e[0m";
read years;
echo "\e[1;36m OLD YEARS of $name : $years old. \e[0m";
sleep 4;
clear;
echo "\e[1;35m PUSH GAME \e[0m";
# Rules of game
echo "In this game you must be found a good letters for writting words! ";
#a for easy 5 letters
#b for medium 8 letters
#* for hard
echo "Welcome in the gmae:" ;
echo -n "\e[1;35m EASY \e[0m";
echo "SHUFFLE: o r s y r";
echo "HERE PUSH A GOOD WORD!";
read game1
if [ $game1 = "sorry" ]; then
echo "WELL! Congratulations!";
else
echo "SORRY! A next once! ";
fi;
echo "SHUFFLE: o n e y j";
echo "HERE PUSH A GOOD WORD!";
read game2
if [ $game2 = "enjoy" ]; then
echo "WELL! Congratulations!";
else
echo "SORRY! A next once! ";
fi;
echo "SHUFFLE: c s u k d";
echo "HERE PUSH A GOOD WORD!";
read game1
if [ $game1 = "ducks" ]; then
echo "WELL! Congratulations!";
else
echo "SORRY! A next once! ";
fi;
echo "SHUFFLE: s e v w i ";
echo "HERE PUSH A GOOD WORD!";
read game2
if [ $game2 = "views" ]; then
echo "WELL! Congratulations!";
else
echo "SORRY! A next once! ";
fi;
echo "SHUFFLE: i o d v e ";
echo "HERE PUSH A GOOD WORD!";
read game1
if [ $game1 = "video" ]; then
echo "WELL! Congratulations!";
else
echo "SORRY! A next once! ";
fi;
# QUIT a game
sleep 5;
echo "\e[1;35m ########## \e[0m";
echo "\e[1;35m END OF GAME \e[0m";
echo "\e[1;35m ########## \e[0m";
# QUIT a game
sleep 5;
exit 0
Saving the programm as lines two on ours document: PushGameDemo.sh
Now, go to the good "repertory". Where is locate your document and write this command for run it: sh PushGameDemo.sh