-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·65 lines (63 loc) · 1.21 KB
/
script.sh
File metadata and controls
executable file
·65 lines (63 loc) · 1.21 KB
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
60
61
62
63
64
65
#!/bin/bash
MENU=0
ORA(){
clear
read -p "Digite o nome do arquivo" NOME
sort $NOME
echo "Pressione [enter] para finalizar"
read temp
}
ORN(){
clear
read -p "Digite o nome do arquivo" NOME
sort -n $NOME
echo "Pressione [enter] para finalizar"
read temp
}
CLD(){
clear
read -p "Digite o nome do arquivo" NOME
uniq -c $NOME
echo "Pressione [enter] para finalizar"
read temp
}
MLD(){
clear
read -p "Digite o nome do arquivo" NOME
uniq -d $NOME
echo "Pressione [enter] para finalizar"
read temp
}
EUC(){
clear
read -p "Digite o nome do arquivo" NOME
sort $NOME
read -p "Qual coluna quer mostrar?" NUM
cat $NOME | cut -d ' ' -f$NUM
echo "Pressione [enter] para finalizar"
read temp
}
MAD(){
clear
read -p "Digite o nome do arquivo" NOME
read -p "Digite o nome do arquivo" NOME2
diff $NOME $NOME2
echo "Pressione [enter] para finalizar"
read temp
}
while [ $MENU != 7 ]; do
echo "1) Organize Alfabeticamente"
echo "2) Organize Numericamente"
echo "3) Conte linhas Duplicadas"
echo "4) Mostre linhas Duplicadas"
echo "5) Escolha uma coluna"
echo "6) Mostre a diferença"
echo "7) Sair"
read MENU
[ $MENU == 1 ] && ORA
[ $MENU == 2 ] && ORN
[ $MENU == 3 ] && CLD
[ $MENU == 4 ] && MLD
[ $MENU == 5 ] && EUC
[ $MENU == 6 ] && MAD
done