I have a bash script thats cat'ing and then using awk to get some variables - the first one works fine but the second has a leading $ and a trailing \r ... thoughts?
#!/bin/bash
newTS=$( cat times.txt | awk -F';' '{print $2}')
ctime=$( cat times.txt | awk -F';' '{print $3}')
echo 'nextTime='$newTS
echo 'currentTime='$ctime
why does the echo command result in
+ echo $'currentTime=2020-04-21T12:36:14\r'
where as the first awk does not??
+ echo nextTime=2020-04-21T11:46:11
must be something with quoting or variable expansion ??
here's my times.txt file:
2020-04-21T11:45:11;2020-04-21T11:46:11;2020-04-21T12:36:14
bash -x
, right? – Kusalananda♦ Apr 21 '20 at 17:13