How to create script file using linux SuSE
![qa-featured](https://www.techyv.com/sites/default/users/superadmin/qa-featured-300x270.png)
I am using linux SUSE. I don’t know much about terminal commands. I want to create shell script or file having program. How to run program and show results on terminal? Tell me an easy way.
![](https://techyv.com/sites/default/2016/10/techpedia_logo.png)
I am using linux SUSE. I don’t know much about terminal commands. I want to create shell script or file having program. How to run program and show results on terminal? Tell me an easy way.
You want to write program through terminal. You need to follow some steps. In fact follow some commands.
First create file. Come to the desktop directory.
> cd Desktop
Desktop> cat > filename.sh
Your file is created. You can see it on your desktop. Now write program.
If(test “$1” –lt 50) && (test “$1” –ge 10);
Then
Echo “you are kid”
Elif(test “$1” –lt 50) && (test “$1” –ge20);
Then
Echo “you are between 20 to 50”
fi
This is the lines of code. Write it properly. Then press ctrl+D
You will come to the prompt. That is >
> chmd +x filename.sh
> ./filename.sh 23
23 is your input. You may write anything.
The output will come out.
Your are between 20 to 50.
This is a short tutorial, you can follow it for understanding.