I'm having issues with the following bash script trying to parse a version number from a WordPress readme file.
cat readme.txt | { while read -r a b c d; do if [ ${a} == "Stable" ] && [ ${b} == "tag:" ]; then VERSION="$c" fi done out="Updated to version $VERSION thanks" echo $out } The output I expect is
Updated to version 1.15 thanks but the actual output is
thanks to version 1.15 as though the 'thanks' is replacing the front of the string, not being appended to the end. Any clues?