Ahmed Amayem has written 90 articles

A Web Application Developer Entrepreneur.

Bash Arrays 3: Different Methods for Copying an Array

Pre-requistites Knowing how to declare an array and set its elements Knowing how to get the indices of an array Knowing how to cycle through an array Setup This is the same setup as the previous post Let’s make a shell script. In your favourite editor type #!/bin/bash And save it somewhere as arrays.sh. Now…

Bash Arrays 2: Different Methods for Looping Through an Array

In the previous shell array post we discussed the declaration and dereferencing of arrays in shell scripts. This time we will take a look at the different ways of looping through an array. Setup This is the same setup as the previous post Let’s make a shell script. In your favourite editor type #!/bin/bash And…

Bash Arrays 1: Intro, Declaration, Assignments, Dereferncing (accessing elements) and special subscripts

During my attempts at making a recursive shell script that ouputs a graphical tree display of a directory structure I ran into some trouble with arrays, so I decided to delve deeper into arrays to better understand them. Setup Let’s make a shell script. In your favourite editor type #!/bin/bash Save it somewhere as arrays.sh.…

Finding the kernel version in OpenVZ CentOS 6

When running a Linux server it is sometimes necessary to check which kernel version you are using to be able to choose certain software to install etc. There are a few ways to do this. We will be trying out the methods in this linfo.org article. Since I am running an OpenVZ CentOS 6 Linux…

Checking if your CentOS system is original or a virtualization version (OpenVZ)

As I was finding the kenel version of my Linux server I hit some issues as I ran this command. [ahmed@amayem kernel]$ uname -r 2.6.32-042stab078.28 I noticed that that version string is a bit unusal. It has stab in it. Kernel version 2.6.32 was released by kernel.org and I don’t see a stab in the…