-
Notifications
You must be signed in to change notification settings - Fork 0
/
sortare.sh
89 lines (69 loc) · 1.54 KB
/
sortare.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
function printare_meniu() {
clear
echo "Alegeti una din obtouni :"
echo "1) Dintr-o data"
echo "2) De la o adresa de email"
echo "3) Dintr-o categorie"
echo "9) exit "
gestionare_meniu
}
function vizualizare_categorii() {
clear
echo "Exemplu : UNREAD, UPDATES, INBOX"
echo -n "Categorie:"
read categorie
input="Index.txt"
while IFS= read -r line
do
if [ "$(head -n 1 "$line" | egrep -n "$categorie")" != "" ]
then
echo "$line"
fi
done < "$input"
echo "*Final*"
read -n1 -p "" a
printare_meniu
}
function vizualizare_email() {
clear
echo "Exemplu : contact@bestjobs.eu"
echo -n "Email:"
read email
input="Index.txt"
while IFS= read -r line
do
if [ "$(head -n 4 "$line" | tail -n 1 | egrep -n "$email")" != "" ]
then
echo "$line"
fi
done < "$input"
echo "*Final*"
read -n1 -p "" a
printare_meniu
}
function vizualizare_data() {
clear
echo "Exemplu : 20-Oct-2020"
echo -n "Scrieti data in format dd-mm-yyyy:"
read data
path=$(head -n 1 "$USER".cfg | grep -o "/.*$")
if test -d ""$path"/"$data"/"; then
find "$path"/"$data"/ -type f
else
echo "Nu exista emailuri din ziua respectiva"
fi
read -n1 -p "" a
printare_meniu
}
function gestionare_meniu() {
read -s -n1 -p "" nr
case $nr in
1) vizualizare_data ;;
2) vizualizare_email ;;
3) vizualizare_categorii ;;
9) bash start.sh ;;
*) printare_meniu;
esac
}
printare_meniu