I'm trying to capture the output of a command substitution. This works until a pipe is added to the command. Am I doing something wrong or is this a quirk of mingw?
$ bash --version
GNU bash, version 4.3.46(2)-release (x86_64-pc-msys)
$ echo $(ls | wc -l)
23
$ test=$(ls | wc -l); echo test="$test"
test=