---
# System prepended metadata

title: WEEK THREE JOURNEY

---

Still digging deep into shell script/scripting, week three we look  into the conditionals, but before then we look into operators most especially comparism operators.

These operators shell scripting are as follows:




| Syntax  | In word |What it represent |
| -------- | -------- | -------- |
| -eq     | equal to     |which compare what is on the left and right   |
-ne |not equal to |what is on the left is not eqaul to what is on the left
-gt |greater than |comparing what is right and the left to see which one is greater
-lt |less than | comparing what is right and letf to which one is less than which
-ge |greater than or equal to | compares whether what is on the left is greater than or they are of equals to what is on the right
-ls | less than or equal to | compares whether what is on the left is less than or equal to what is on the right

These are  basically the comparism operators we have and use as well.

Furthermore, with the above the understanding, we dive into loops, 
 A loop is a powerful programming tool that enables you to execute a set of commands repeatedly, there are different type of loop;
 1. while loops
 2. for loops
 3. The until loops
 4. the select loops
We only dwell more while and for loops, i understood that while loop is infinite loop, it  keeps running until a the condition specify is met and you can stop it fro running with the use of break.

syntax for while loop
 while true; do
 [condition];
 do
 
![Screenshot from 2025-06-30 02-34-37](https://hackmd.io/_uploads/H16-owJrxl.png)
This is a simple applicatio of while loop, counting number from 100 and drom 100 do to 0. this also include our camparising operators -ge and -le.
![Screenshot from 2025-06-30 02-39-40](https://hackmd.io/_uploads/HkhmmtkBee.png)
this is the output of our code, on execution, it will now print 1-100 in both ascendint and decending order.

On the other hand, The for loop operates on lists of items. It repeats a set of commands for every item in a list.
this is our syntax  for loop

for [condition];
do
echo "something"
done

![Screenshot from 2025-06-30 04-33-08](https://hackmd.io/_uploads/SkTWvYJrle.png)

its a simple arithmetics, we want to print both odd and even number and also have the sum of these numbers.

![Screenshot from 2025-06-30 04-48-16](https://hackmd.io/_uploads/rydxcKJBll.png)

The above image shows our output on execution, and that how for loop help us execute.

Challenges

challenge of thinking and to put the logic in other, the lest thing to write is the code, once you unnderstand the logic, the code is as well done.




