diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-15 16:30:17 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-15 16:30:17 -0500 |
commit | 6a995ac64be59a112603f9f19e959ee1786960eb (patch) | |
tree | c348a72270044784ae3d8f790430d3ebd85b482c | |
parent | 4b8e5fce3d1dc322bd941b6b0eec0200f0296bda (diff) |
[refactor] list command; simplify awk expression
-rwxr-xr-x | threadcat-list.sh | 8 |
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 |