For লুপ এর ব্যবহার

bash-3.2$ cat multiplication.sh
#!/bin/bash

# Example use of function/method declaration in Shell Programming
# Example use of for loop

#a function that will multiply 1 to 10 with 5
multiplication()
{
x=5
for i in {1..10}
do
echo $i
echo “the multiplication result is:” $(($i*$x))
done
}

echo “Print 1 to 10; also multiply each number with 5 and show the multiplication result”
multiplication

—————————–
Output – ফলাফল

bash-3.2$ ./multiplication.sh
Print 1 to 10; also multiply each number with 5 and show the multiplication result
1
the multiplication result is: 5
2
the multiplication result is: 10
3
the multiplication result is: 15
4
the multiplication result is: 20
5
the multiplication result is: 25
6
the multiplication result is: 30
7
the multiplication result is: 35
8
the multiplication result is: 40
9
the multiplication result is: 45
10
the multiplication result is: 50