-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrada.sh
More file actions
60 lines (45 loc) · 768 Bytes
/
entrada.sh
File metadata and controls
60 lines (45 loc) · 768 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
49
50
51
52
53
54
55
56
57
58
59
#/bin/bash
read x
y=5
for ((i=0;i<=10;i++))
do
echo "estou no for"
done
function hello {
echo "Funcao Hello"
(( y = x / 2 ))
echo $y
}
COUNTER=20
until [ $COUNTER -lt 10 ]
do
echo $COUNTER
(( COUNTER-- ))
done
while [ $x -le 10 ]
do
if [ $x -le 2 ] ; then
(( y = y - 1 ))
echo "entrou no if"
elif [ $x -ge 5 ] ; then
echo "entrou no elif"
(( y = y - 1 ))
else
echo "entrou no else"
fi
(( x++ ))
done
hello
echo "Switch case, (1) case simples, (2) case | case, qualquer outro numero, DEFAULT "
read DISTR
case $DISTR in
1)
echo "Case Simples."
;;
2|3)
echo "case | case)"
;;
*)
echo "Default."
;;
esac