From 6a995ac64be59a112603f9f19e959ee1786960eb Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 15 Aug 2022 16:30:17 -0500 Subject: [refactor] list command; simplify awk expression --- threadcat-list.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/threadcat-list.sh b/threadcat-list.sh index 9381162..806485e 100755 --- a/threadcat-list.sh +++ b/threadcat-list.sh @@ -8,13 +8,13 @@ LISTING_HEADING="~~~~~~~~~~~~~~~~~~~" if [ -z "${BOARD}" ]; then echo "BOARDS" echo $LISTING_HEADING - ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }' + ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep ^d" | awk '{print ($6 " " $7 " " $8 " -- " $9);}' echo "" echo "TOP LEVEL THREADS" echo $LISTING_HEADING - ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep -v ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }' | grep -v '^ *$' + ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep -v ^d" | awk '{print ($6 " " $7 " " $8 " -- " $9);}' | grep -v '^[ \-]*$' else - echo "LISTING THREADS UNDER $BOARD" + echo "BOARD: $BOARD" echo $LISTING_HEADING - ssh $THREADCAT_USER "ls -lt /opt/threadcat/$BOARD | grep -v ^d" | awk '{ s = ""; for (i = 6; i <= 9; i++) s = s $i " "; print s }' | grep -v '^ *$' + ssh $THREADCAT_USER "ls -lt /opt/threadcat/$BOARD | grep -v ^d" | awk '{print ($6 " " $7 " " $8 " -- " $9);}' | grep -v '^[ \-]*$' fi -- cgit v1.2.3