Scripting Series – Part 6 of 8

Here we will dive into part 6 in the shell scripting series. Today we will look at how you can use a for loop to iterate through all files in a directory and the function of file comparison. Shell scripting is essential in production environments for automating repetitive tasks, ensuring consistency, and minimising human error. It enables engineers to streamline deployments, manage system configurations, monitor processes, and orchestrate complex workflows with precision. In a high-availability environment, shell scripts act as reliable, lightweight tools that reduce manual intervention and improve operational efficiency. Create the script using VIM. Write the script in VIM and save the file. Apply the necessary permissions to the script so it can be executed. If we do a ls –ltrh we see that the script has been created. It has a green colour to it – indicating that it is now executable. Execute the script using ./ The output of the script, after it has been executed. Stay tuned, part 7 in the series coming tomorrow! Connect with me on LinkedIn #30DaysLinuxChallenge #RedHatEnterpriseLinux #CloudWhistler #CloudEngineer #Linux #DevOps #RedHat #OpenSource #CloudComputing #Automation #CloudEngineer #SysAdmin #ITSecurity #TechTips #BusinessIT #Leadership

May 4, 2025 - 14:07
 0
Scripting Series – Part 6 of 8

Here we will dive into part 6 in the shell scripting series. Today we will look at how you can use a for loop to iterate through all files in a directory and the function of file comparison.

Shell scripting is essential in production environments for automating repetitive tasks, ensuring consistency, and minimising human error. It enables engineers to streamline deployments, manage system configurations, monitor processes, and orchestrate complex workflows with precision. In a high-availability environment, shell scripts act as reliable, lightweight tools that reduce manual intervention and improve operational efficiency.

Create the script using VIM.
Image description

Write the script in VIM and save the file.
Image description

Image description

Apply the necessary permissions to the script so it can be executed.
Image description

If we do a ls –ltrh we see that the script has been created. It has a green colour to it – indicating that it is now executable.
Image description

Execute the script using ./
Image description

The output of the script, after it has been executed.
Image description

Image description

Stay tuned, part 7 in the series coming tomorrow!


Connect with me on LinkedIn


#30DaysLinuxChallenge #RedHatEnterpriseLinux
#CloudWhistler #CloudEngineer #Linux
#DevOps #RedHat #OpenSource
#CloudComputing #Automation
#CloudEngineer #SysAdmin #ITSecurity #TechTips #BusinessIT #Leadership