-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsked
executable file
·56 lines (49 loc) · 1.59 KB
/
sked
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
#!/bin/bash
#http://www.eibispace.de/
#http://www.eibispace.de/dx/sked-b17.csv
if [ -z "$1" ]; then
echo "Please give data file."
exit 1
fi
if [ -n "$2" ]; then
HHMM="$2"
else
HHMM=`date -u +%H%M`
fi
case $(date -u +%u) in
1) day="Mo";;
2) day="Tu";;
3) day="We";;
4) day="Th";;
5) day="Fr";;
6) day="Sa";;
7) day="Su";;
esac
FILE_IN=$(iconv -f utf-8 -t utf-8 -c "$1"| grep ";R;" | \
# grep -E "RUS|EEu" | \
grep -E -v "Volmet|DIGITAL|AutoRadioKlub|Aero|;FE;|;Sib;" | \
tr " " "_" | \
grep -E -v "Vesti_FM|IRiT_Weather_Radio|Russian_Spy_Numbers|Russian_Air_Force")
# echo "$FILE_IN" | wc -l
echo "prosessing..."
for one_string in `echo "$FILE_IN"`
do
TIME1=`echo "$one_string" | cut -d ";" -f2 | cut -d "-" -f1`
TIME2=`echo "$one_string" | cut -d ";" -f2 | cut -d "-" -f2`
if [ "$HHMM" -ge "$TIME1" ] && [ "$HHMM" -le "$TIME2" ]
then
REGION=`echo "$one_string" | cut -d ";" -f7`
LANGUAGE=`echo "$one_string" | cut -d ";" -f6`
# if [ "$REGION" == "RUS" ] || [ "$REGION" == "EEu" ]
# then
DATES=`echo "$one_string" | cut -d ";" -f3`
date_normal=$(echo "$DATES" | grep -E "Mo|Tu|We|Th|Fr|Sa|Su" -c)
date_present=$(echo "$DATES" | grep "$day" -c)
if [ $date_normal -eq 0 ] || [ $date_present -gt 0 ]; then
FREQ=`echo "$one_string" | cut -d ";" -f1`
NAME=`echo "$one_string" | cut -d ";" -f5`
echo -e "Freq: $FREQ; \t$REGION from $TIME1 to $TIME2 $DATES : $NAME $LANGUAGE"
fi
# fi
fi
done