Bash While Loop: An Easy Way to Print Odd Numbers from 1 to N

In this article you will learn how to create a while loop in Bash.

While loops are used in Bash scripting and in many other programming languages…

The loop will go through N numbers and print only the odd ones.

You will see how our script looks like if we hardcode the value of N in it, and then you will learn…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Claudio Sabato

Claudio Sabato


I’m a Tech Lead, Software Engineer and Programming Coach. I want to help you in your journey to become a Super Developer!