Shell script tutorial: Shell script Function

function with argument example

The function is one of the most powerful feature of the shell script. Function is the line of codes between two parenthesis which is executed when it is called. The functions in shell script can or cannot contains the arguments. For example: we can create a function with the function name ‘addition’ which will add [...]

How to make your own calculator using shell script in Linux

Calculator Menu

Shell script is the powerhouse of Linux. We have done various things in shell scripting up to now. If you are reaching this tutorial directly and you don’t have a single clue about the shell script I recommend looking at our shell scripting section first. In this tutorial we are going to build a simple [...]

Shell Script: Case structure and Select Statement

case structure in shell script

The case structure like if statement is used in decision making in the shell script. We already find out how to make the decisions using if and else statement. Case structure provides a multiple branch decision mechanism. The case statement works both on bash shell and korn shell. You can install on Korn shell in [...]

Shell Script Looping: while, until, for

while loop in shell script

Loop or iteration is repeats certain instructions again and again until the given condition is true. The block of code under the loop is executed repeatedly until the condition is true. There are three kinds of loop: while, until and for. If you are unfamiliar with the shell scripts, first look our previous tutorial on [...]

Decision making in shell script(if..else condition)

output of if statement

The if and else condition is used in decision making in shell script. If the given condition is true, the command is executed otherwise won’t. Condition is the comparison between the values. For example, you have seen in some websites, “Enter only if you are 18+”. If you click on Yes you can enter into [...]

Linux/Unix Shell Script Basic: User Inputs and variables

User input

This tutorial is continue to the how to write, save and execute the shell script. If you are already a programmer, then you are already familiar with the word variable. Variable is something that stores the value temporarily. We can store anything in the variable and later call that variable. Also, we can ask to [...]

How to write, save and execute script file in Linux[Shell Scripting]

echo shell

You have just entered or executed more than one command at a time using two ways in how to run multiple commands at same time. There are two ways to do it. In the second way, instead of writing the command in terminal directly we wrote the command in a file, save it and later [...]