Commit be0aa9b Julia
committed
0 parents commit be0aa9b Copy full SHA for be0aa9b
File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Printing all numbers in range 1 to 10"
4
+ for x in {1..10}; do echo $x ; done
5
+ # That is how to output empty line
6
+ echo -en " \n"
7
+
8
+ echo " Printing all odd number in range 1 to 10"
9
+ seq 1 2 10
10
+ echo -en " \n"
11
+
12
+ echo " Let's do some arithmetic. Give me first number: " ; read a
13
+ echo " Give me second number: " ; read b
14
+ echo " The sum is $(( $a + $b )) "
15
+ echo " The difference is $(( $a - $b )) "
16
+ echo " The product is $(( $a * $b )) "
17
+ if (( $b == 0 )) ; then
18
+ echo " Division by 0 is not allowed" ;
19
+ else
20
+ echo " The quotient is $(( $a / $b )) "
21
+ fi
22
+ echo -en " \n"
23
+
24
+
25
+ echo " Let's compare two numbers. Give me first number: " ; read a
26
+ echo " Give me second number: " ; read b
27
+ if (( $a > $b )) ; then
28
+ echo " The first one is bigger" ;
29
+ elif (( $a < $b )) ; then
30
+ echo " The second one is bigger" ;
31
+ else
32
+ echo " The are equal!" ;
33
+ fi
You can’t perform that action at this time.
0 commit comments