Bash Tutorial

The Bash shell provides some variables that are prefixed with ‘~’ (named tilde) which is called Tilde Expansions.

They are synonyms for contents of other variables within your shell.

Tilde expansion is the process of converting these abbreviations to the directory names that they stand for. In this article, let us review the tilde expansion feature with the examples.
(more…)

{ 6 comments }

Bash Shell expansion

One of the operation of the shell when it analyzes the input is Shell expansion. Bash provides different types of expansion. In this article let us review an important expansion — “Brace expansion”.

This article is part of our on-going Bash Tutorial series.
(more…)

{ 5 comments }

An array is a variable containing multiple values may be of same type or of different type.  There is no maximum limit to the size of an array, nor any requirement that member variables be indexed or assigned contiguously. Array index starts with zero.

In this article, let us review 15 various array operations in bash.
(more…)

{ 13 comments }

As part of our on-going bash tutorial series, we discussed about bash positional parameters in our previous article. In this article let us discuss about the bash special parameters with few practical shell script examples.

Some of the bash special parameters that we will discuss in this article are: $*, $@, $#, $$, $!, $?, $-, $_
(more…)

{ 6 comments }

A parameter is an entity that stores values. It can be a name, a number or some special characters. A variable is a parameter denoted by a name. Some variables are set for you already, and most of these cannot have values assigned to them.

These variables contain useful information, which can be used by a shell script to know about the environment in which it is running.
(more…)

{ 6 comments }

This article is part of our on-going bash tutorial series. Like any other programming languages, Bash also provides variables.

Bash variables provide temporary storage for information that will be needed during the lifespan of the program.
(more…)

{ 4 comments }

Bash shell functions are a way to group several UNIX / Linux commands for later execution using a single name for the group. Bash shell function can be executed just like a regular Unix command. Shell functions are executed in the current shell context without creating any new process to interpret them.
(more…)

{ 10 comments }

Photo Courtesy: pchow98

While most of us cannot kick someone ass like Jennifer Garner in Alias, we can at least try to use the Linux alias command effectively.

An alias command is simple string substitution of one text for another, when it is used as the first word of a simple command.

In this article let us review how to set / unset bash aliases permanently and temporarily. Let us also review some useful bash alias examples that you can use in your bash startup files.
(more…)

{ 12 comments }