How to add header and trailer line to a file in Linux
In this article, we will see the different ways to add a header record or a trailer record to a…
In this article, we will see the different ways to add a header record or a trailer record to a…
The Basics So here we will print the pyramid of stars in two parts as shown below. We will loop…
A prime number is a whole number that has exactly 2 different factors, 1 and itself. A number that is…
As usual, in Linux, there are more than 1 way to accomplish a task. To convert a file (input.txt) to…
Bubble sort is a simple algorithm that basically bubbles up the elements of the array. This means that it traverses…
Sed is a stream editor in a UNIX-like operating system that is used for filtering and transforming text. Sed is…
One of the most useful features of shell scripts is the lowly back quote character, usually called the backtick (`)…
1. Find empty directories in the current directory using find -empty: $ find . -type d -empty 2. Use the…
Check root at start of script Some scripts need to be run as root and you may want to check…
User-Defined Functions You can create user-defined functions in a awk script file using the func or function keywords. Placement in…