From a8910cb2c659e193c6ff6a96f02de28ff7e1ebfe Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Wed, 29 Jul 2020 19:28:54 -0700 Subject: [PATCH] text: show logfiles in order of last contacted (use sxmo_contacts.sh) --- scripts/modem/sxmo_modemtext.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index 1fc819b..7252e4e 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -96,12 +96,10 @@ main() { # E.g. only display logfiles for directories that exist and join w contact name ENTRIES="$( printf %b "Close Menu\nSend a Text\n"; - # shellcheck disable=SC2045 - for TDIR in $(ls -1 -t "$LOGDIR"); do - [ -d "$LOGDIR"/"$TDIR" ] || continue - NUM="$(basename "$TDIR")" - sxmo_contacts.sh | grep -m1 "$NUM" | xargs -IL echo "L logfile" - done + sxmo_contacts.sh | while read -r TDIR; do + [ -d "$LOGDIR"/"$(printf %b "$TDIR" | cut -d: -f1)" ] || continue + printf %b "$TDIR" | xargs -IL echo "L logfile" + done )" CONTACTIDANDNUM="$(printf %b "$ENTRIES" | menu dmenu -p Texts -c -fn Terminus-20 -l 10 -i)" echo "$CONTACTIDANDNUM" | grep "Close Menu" && exit 1