I have the following script
echo ".*/tools/.*"
var=$(echo ".*/tools/.*")
echo $var
The output of this is
.*/tools/.*
./tools/. ./tools/..
I would expect the output of this to be
.*/tools/.*
.*/tools/.*
Why is var
being assigned multiple values? And how can I have it output the expected value?
tools
is a folder in my current working directory, so I assume it has something to do with that.
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)