Apparently bash-4.4 changed how unquoted here strings are treated.
We want to process only the first line of the output, so the right
thing to do is to ask awk to exit after processing the first line.
This works regardless of the bash version.
test_duration()
{
local t=$(exec 2>&1 1>/dev/null; time -p "$@")
test_duration()
{
local t=$(exec 2>&1 1>/dev/null; time -p "$@")
- result=$(awk '{print $2 * 1000}' <<< $t)
+ result=$(awk '{print $2 * 1000; exit 0}' <<< "$t")