Day-05: How to Print Even Numbers Using a while Loop in Bash
The Initial Script: Why It Only Prints 0?
Here’s the initial script that only prints 0 and exits:
#!/bin/bash
num=0
while [[ $(expr $num % 2) -eq 0 && $num -le 10 ]]
do
echo $num
num=$((num + 1))
done
What’s Happening?
The script initializ...
pakeezas.hashnode.dev2 min read