The old style backticks ` ` and the $( ) constructions do the same thing, but treat the backslashes different. Using backticks: $ echo `echo test` test Using $( ): $ echo $(echo test) test In the $( ) construction,…
The old style backticks ` ` and the $( ) constructions do the same thing, but treat the backslashes different. Using backticks: $ echo `echo test` test Using $( ): $ echo $(echo test) test In the $( ) construction,…
The functions and the aliases are very usefull. Both, the aliases and the functions have the same purpose. Making the terminal usage easier. When you cannot alias something, function it. The functions get the arguments passed. Syntax: Function_Name () {…
Like in the C programs, the exit command terminates a script. It can also return a value which is read by the script’s parent process. The exit status is also known as return status or exit code. By convention, a…
Escaping is a method of quoting single characters. The escape (\) preceding a character tells the shell to interpret that character literally. With some commands, like sed and echo, for example, the escaping has the opposite effect, it toggles on…
In Linux and Unix, the echo command is used to write text in files or at the standard output (stdout) and to display the values of variables. Examples of using echo: $ echo “Hello” Hello $ PI=3.14 $ echo $PI…
In this article I will show you how to create variables and set values to variables. This is an easy thing to do, but very important in shell scripting. I will use echo to display the variable values. How to…