To add colors to Maestro MHOs ports dump and sort by label_port just run:
sx_api_ports_dump.py | head -n -1|(sed -u 3q;sort -t'|' -k4)|sed '1h;$G'|sed ''/label_port/s//$(printf "\033[1mlabel_port\033[0m")/g''|sed ''/UP/s//$(printf "\033[32mUP\033[0m")/g''|sed ''/DOWN/s//$(printf "\033[31mDOWN\033[0m")/g''|sed 's/UNPLUGGED/TMP/g'|sed 's/PLUGGED-ERR/TPM/g'|sed ''/PLUGGED/s//$(printf "\033[32mPLUGGED\033[0m")/g''|sed ''/TMP/s//$(printf "\033[31mUNPLUGGED\033[0m")/g''|sed ''/TPM/s//$(printf "\033[41mPLUGGED-ERR\033[0m")/g''
For additional information run:
orch_stat -a | sed ''/UP/s//$(printf "\033[32mUP\033[0m")/g''|sed ''/DOWN/s//$(printf "\033[31mDOWN\033[0m")/g''|sed 's/UNPLUGGED/TMP/g'|sed 's/PLUGGED-ERR/TPM/g'|sed ''/PLUGGED/s//$(printf "\033[32mPLUGGED\033[0m")/g''|sed ''/TMP/s//$(printf "\033[31mUNPLUGGED\033[0m")/g''|sed ''/TPM/s//$(printf "\033[41mPLUGGED-ERR\033[0m")/g''|sed '/-+-/d'|sed '/^$/N;/^\n$/D'