#!/bin/bash BOARD_NAME=$1 THREAD_NAME=$2 if [ -z "${THREAD_NAME}" ]; then THREAD_NAME=$BOARD_NAME else THREAD_NAME=$BOARD_NAME/$THREAD_NAME fi if [ ! -z "${THREAD_NAME}" ]; then readarray -t lines < <(ssh $THREADCAT_USER "cat /opt/threadcat/$THREAD_NAME") for line in "${lines[@]}"; do if [[ $line =~ ^=== ]]; then echo -e "\e[0;36m$line\e[0m" else echo $line; fi done else echo You did not provide a thread name. echo USAGE: "threadcat read [BOARD] THREAD" fi