aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-08-15 16:30:17 -0500
committerColin Okay <colin@cicadas.surf>2022-08-15 16:30:17 -0500
commit6a995ac64be59a112603f9f19e959ee1786960eb (patch)
treec348a72270044784ae3d8f790430d3ebd85b482c
parent4b8e5fce3d1dc322bd941b6b0eec0200f0296bda (diff)
[refactor] list command; simplify awk expression
-rwxr-xr-xthreadcat-list.sh8
1 files 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