bash functions and variables

Bash allows you to use variables inside functions. By default bash's functions have the variables as a script: $1 first argument, $2  the second argument etc until number 9 $@ an array of all the  arguments to the function $# the number of all arguments So let say we want to create a function that calculates … Continue reading bash functions and variables

Advertisements

Bash math calculation 1

There are a few ways to do math calculations in bash. The first option is to use the Linux command expr. we can use this command to do the simple math calculation like addition, subtraction, multiplication, and division. we use the following signs, + for addition, - for subtraction, \* for multiplication, / for division. We … Continue reading Bash math calculation 1

Docker getting started – part 2

If we want to install docker on different Linux distributions, then the best way is to check the instruction on the docker website: https://docs.docker.com/engine/installation/ It has specific instructions for the different distributions. After installing docker, we should check the docker version by running: docker -v And we will see the docker version and the build … Continue reading Docker getting started – part 2

Docker getting started – part 1

Docker is a software that allow us to do operating system visualization. It uses the  Linux kernel to isolate process  from their host machine and other process. The docker itself is written with Go. You can install docker on windows and Macintosh, but it in order to work on those system, it will install a linux VM. … Continue reading Docker getting started – part 1

Linux type command – knowing what will be executed

In Linux, you can check what will run when you execute command. The first information you need is the type of the command, if it is a built-in shell, alias, or an executable file. The type command gives that information: type <command> And it will tell you the command type: In the example below, we run type … Continue reading Linux type command – knowing what will be executed