forked from MadhavBahl/OperatingSystem-Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.sh
More file actions
40 lines (36 loc) · 691 Bytes
/
loop.sh
File metadata and controls
40 lines (36 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Author : Madhav Bahl
# github : https://github.com/MadhavBahlMD
# Script follows here:
read -p "Please enter a number: " n
echo "You just entered: $n"
echo "Now we count from 1 to $n"
for((i=1;i<=n;i++))
{
if [ $i != $n ];
then
echo "$i"
echo "|"
else
echo "$i"
fi
}
echo "Thanks"
read -p "What is your name?" name
echo " a. Hello"
echo " b. Good morning"
echo " c. Good night"
echo " d. Bye"
read -p "Enter a choice: " ch
case "$ch" in
"a") echo "Hello, $name"
;;
"b") echo "Good morning, $name"
;;
"c") echo "Good night, $name"
;;
"d") echo "Bye, $name"
;;
*) echo "YOU REBEL!!!!!"
;;
esac