I have a test file with following content:
k1:v1
I'd like to get v1
and concatenate with a string a
using AWK command below:
cat test.txt | grep k1 | awk -F: '{print $2"a"}'
Expected the result is v1a
, but I got a1
. If I concatenate with aa
, then I got aa
. Seems like it overwrites the string v1
from beginning. I have been debugging for a long time, I cannot see any reason to cause this.