Category: Advance Shell
-
Shell Scripting let command
The let command is an arithmetic operator. It is almost same as (( )). Only difference is that, let is an arithmetic command while (( )) is a compound command. It is a built-in command which instructs shell to perform an evaluation of arithmetic expressions. No spaces should be used around the arithmetic operant with let command. Look at…
-
Shell Scripting eval command
The eval command is a built-in command. It takes a string as its argument and evaluate it, then run the command stored in the argument. It allows using the value of a variable as a variable. Example 1: Look at the above snapshot, command “echo \${$User}” runs $User as a shell variable and displays its output. But…
-
Shell Scripting case
A case construct helps us to simplify nested if statement. You can match several variables against one variable. Each case is an expression matching a certain pattern. Syntax: Look at the above snapshot, you can write one pattern or more than one pattern together according to the situation. Let’s see an example to understand it…
-
Shell Functions
With the help of functions, overall functionality of a function can be divided into smaller or logical parts, which can be called to perform their task. It helps us to check our program part by part. We can reuse the function where ever we want. To create a function Syntax: You will call your function…