DevOps

Beginners Guide to Using “trap” to Catch Signals and Handle Errors in Shell Script

Shell Signal Values A signal is a message that some abnormal event has taken place or a message requesting another…

How to Make a Variable read-only (constant) in Bash and Korn Shell

Creating Bourne Shell Constants A variable can be made read-only with the following syntax: readonly var[=value] The square brackets around…

Examples of “shift” Command in Shell Scripts

The shift Statement Sometimes a script does not require a specific number of arguments from users. Users are allowed to…

Korn Shell select Loop

The select statement in the Korn shell creates a menu. This construct is for the Korn shell only. The syntax…

How to use “break” and “continue” statements in shell scripts

The break Statement The break statement allows you to exit the current loop. It is often used in an if…

How to use until loop in Shell Scripts

The until Loop The until loop is very similar to the while loop, except that the until loop executes as…

“while” Loop Examples in Shell Scripts

The while loop allows you to repeatedly execute a group of statements while a command executes successfully. The syntax for…

How to Configure Network Namespaces in Docker Containers

This post tells how Docker uses network namespace to isolate resources. The following figure is the lab setup to help…

“su: Authentication failure” – in Docker

The Problem In some situations, a normal user within a Docker container cannot run 'su' command to switch user. When…

How to Pause and Resume Docker Containers

Question: How to Pause and Resume running containers on docker host? This post will help to know about pausing and…