Fix short phone numbers or phone numbers with text do not appear in scripts
Fixes #106 Signed-off-by: Anjandev Momi <anjan@momi.ca> Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
parent
b0bb9ac9fc
commit
741defe781
2 changed files with 7 additions and 7 deletions
|
@ -16,14 +16,14 @@ contacts() {
|
|||
RECENTCONTACTEDNUMBERSREVCHRON="$(
|
||||
cut -f3 "$LOGFILE" |
|
||||
tac |
|
||||
awk '!($0 in a){a[$0]; if (substr($0,1,1) == "+") print}' |
|
||||
awk '!($0 in a){a[$0]; print}' |
|
||||
sed '/^[[:space:]]*$/d'
|
||||
)"
|
||||
printf %b "$RECENTCONTACTEDNUMBERSREVCHRON" | awk -F'\t' '
|
||||
FNR==NR{a[$1]=$2; next}
|
||||
{
|
||||
if (!a[$1]) a[$1] = "Unknown Number";
|
||||
if (substr($0,1,1) == "+") print $0 ": " a[$1]
|
||||
print $0 ": " a[$1]
|
||||
}
|
||||
' "$CONTACTSFILE" -
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue