-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop_switch.sh
More file actions
executable file
·48 lines (41 loc) · 804 Bytes
/
loop_switch.sh
File metadata and controls
executable file
·48 lines (41 loc) · 804 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
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
echo "something"
ls
for (( i = 0; i < 10; i++ )); do
echo "$i"
done
if [ $# -eq 0 ]; then
echo "this is if Bconsidion"
fi
#use of switch case
day="sunday"
case "$day" in
"sunday" )
echo "today is my first day"
;;
"monday" )
echo "today is second day "
;;
"tuesday")
echo "today is third day"
;;
"friday")
echo "today is weekends"
;;
esac
#use of regular expression in condition
name="brahmanandaaaaa"
echo "$name"
if [[ "$name" =~ brahmananda* ]]
then
echo "it is matched "
fi
#while loop and basic understanding
echo "******************************************************"
count=9
((count=count-1))
echo $count
while [[ $count -gt 0 ]] ; do
echo "i am count in while loop $count "
((count = count -1))
done