Blog Archives

The difference between `command` and $(command)

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,

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

Create Simple Bash Functions

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 () {

Tagged with: , , , , , , ,
Posted in The Linux and Unix Articles!

The exit status in shell scripting

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

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!

Escaping characters in shell scripting

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

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!

How to use the echo command in shell scripting

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

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

How to use variables in shell scripting

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

Tagged with: , , , , , ,
Posted in The Linux and Unix Articles!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!