I am trying to store a string value to a temporary variable within my script. When I run the command manually it returns the expected value, but from the script an additional "\r" is at the end.
tCurrentStatus=`cat ${tPC_status} | grep 'Current status' | awk '{print $NF}'`
output:
cat ${tPC_status} | grep 'Current status' | awk '{print $NF}'+ cat /home/jr/EOF/pc_monitor_EOF_status.out
+ grep 'Current status'
+ awk '{print $NF}'
+ tCurrentStatus=$'EOF\r'
Why does the "\r" appear in the script, but not manually?
Thanks in advance for any help.