The shell performs substitution when it encounters an expression that contains one or more particular font.
Here, the printing value of the variable is substituted by its value. Same time, "\n" is substituted by a new line –
You will collect the following result. Here the -e selection enables the interpretation of backslash escapes.
Following is the result without -e option –
Here are following escape sequences which can be used in echo command −
|S.No.||Escape & Description|
You can use the -E selection to disable the interpretation of the backslash escapes (default).
You can use the -n selection to disable the introduction of a new line.
Command substitution is the instrument by which the shell performs a given set of commands and then substitutes their output in the place of the commands.
The command substitution is perform when a command is given as –
When performing the command substitution make sure that you use the back quote, not the single quote character.
Command substitution is normally used to consign the output of a command to a variable. Each of the following examples demonstrates the command substitution –
Upon execution, you will collect the following result –
Variable substitution enables the shell programmer to control the value of a variable based on its state.
Here is the following table for all the feasible substitutions −
|S.No.||Form & Description|
Following is the instance to show different state of the above substitution –
Upon implementation, you will accept the following result –
Unix/Linux Related Interview Questions
|Perl Scripting Interview Questions||Shell Scripting Interview Questions|
|Python Interview Questions||Core Java Interview Questions|
|Linux Interview Questions||Linux Embedded systems Interview Questions|
|Red Hat Linux System Administration Interview Questions||IBM AIX Interview Questions|
|Sybase Interview Questions||IBM AIX 7 Administration Interview Questions|
|Unix Shell Scripting Interview Questions||Linux Shell Scripting Interview Questions|
Unix/Linux Related Practice Tests
|Perl Scripting Practice Tests||Shell Scripting Practice Tests|
|Python Practice Tests||Core Java Practice Tests|
|Linux Practice Tests||Linux Embedded systems Practice Tests|
|Red Hat Linux System Administration Practice Tests||IBM AIX Practice Tests|
|Sybase Practice Tests||IBM AIX 7 Administration Practice Tests|
|Autosys Practice Tests|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.