From 2f01f9cacc54a7889ae600fd3664d221e6e464dc Mon Sep 17 00:00:00 2001 From: Cameron Thompson <50184035+iamromulan@users.noreply.github.com> Date: Sat, 16 Mar 2024 18:53:56 -0400 Subject: [PATCH] Add Color to atcmd --- socat-at-bridge/atcmd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/socat-at-bridge/atcmd b/socat-at-bridge/atcmd index 8705dcb..bdbed10 100644 --- a/socat-at-bridge/atcmd +++ b/socat-at-bridge/atcmd @@ -7,14 +7,14 @@ BAUD=115200 stty -F $DEVICE cs8 $BAUD ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts # Main loop -echo "Type 'exit' to end the session." +echo -e "\033[0;36mType 'exit' to end the session.\033[0m" while true; do - echo -n "Enter AT Command: " + echo -en "\033[0;36mEnter AT Command: \033[0m" read user_input # Exit condition if [[ "$user_input" == "exit" ]]; then - echo "Exiting..." + echo -e "\033[0;32mExiting...\033[0m" break fi @@ -28,11 +28,11 @@ while true; do sleep 0.5 done - # Kill the background reading process - kill $PID - - # Print the response + # Print the response in green + echo -en "\033[0;32m" cat /tmp/response + echo -en "\033[0m" + # Cleanup > /tmp/response ) &