diff options
author | Colin Okay <colin@cicadas.surf> | 2022-08-23 19:28:52 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-08-23 19:28:52 -0500 |
commit | 65a6e08768b998c795f53451598184584da374c0 (patch) | |
tree | e03e939f5173c38873130a242b177580ef11a28d | |
parent | ae65019cee07a91dc062582b50e88da7f02d7024 (diff) |
[change] to list to print out directory mtimes as hours ago
-rwxr-xr-x | threadcat-list.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/threadcat-list.sh b/threadcat-list.sh index 6db8ae6..4d67b24 100755 --- a/threadcat-list.sh +++ b/threadcat-list.sh @@ -10,19 +10,20 @@ export CURTIME=`ssh $THREADCAT_USER date +%s` if [ -z "${BOARD}" ]; then echo "BOARDS" echo $LISTING_HEADING - ssh $THREADCAT_USER "ls -lt /opt/threadcat | grep ^d" | awk '{print $9;}' + ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat | grep ^d" | \ + awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' echo "" echo "TOP LEVEL THREADS" echo $LISTING_HEADING ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat" | \ grep -v ^d | egrep -v '^total [0-9]+$' | \ - awk '{ mins = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", mins, $7;}' + awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' else echo "BOARD: $BOARD" echo $LISTING_HEADING ssh $THREADCAT_USER "ls -lt --time-style=+%s /opt/threadcat/$BOARD" | \ grep -v ^d | egrep -v '^total [0-9]+$' | \ - awk '{ mins = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", mins, $7;}' + awk '{ ago = (ENVIRON["CURTIME"] - $6) / (60*60); printf "%.0f hrs ago -- %s\n", ago, $7;}' fi |