Been searching for solutions to this problem, but haven't found any good ones. Just about every answer assumes Bash and uses arrays, which is not what I want.
So, I have this path, which may have slight variations to it, which I'd like to assign to a variable like so:
debs="${builds}/${name}/${version}"_*.deb
Obviously, this doesn't work as intended, the glob is not expanded in the assignment, see SC2125.
Another thing I tried was to assign with parameter expansion, i.e.
unset debs
: ${debs:="${builds}/${name}/${version}"_*.deb}
This too, doesn't seem to expand the glob the way it's supposed to.
Now, arrays are not an option, so I'm not sure what else there is. One way to do it should be to just expand and echo it, e.g.
debs=$(echo "${builds}/${name}/${version}"_*.deb)
which seems to solve the problem, but doesn't exactly feel "correct". Is there any better, more idiomatic way to go about this without shelling out to echo, or is this as good as it gets when hanging onto ancient shells?