How to create script file using linux SuSE

Asked By 0 points N/A Posted on -
qa-featured

 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.

SHARE
Answered By 0 points N/A #124806

How to create script file using linux SuSE

qa-featured

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.

Login/Register to Answer

Related Questions