I myself use the solution provided by @rsenna et al, but I post this just to suggest an alternative, which people might be interested in.
This project
https://github.com/p-ranav/glob
provides a glob library. As an example, it also provides a very simple stand-alone command for globbing. Out of the box, it doesn't work like glob <pattern>
but it's a very short simple C++ program that can be easily modified.
So, here I report I just modified the source code in a trivial way, compiled everything using the provided make script, and successfully obtained a command line tool that can be an alternative to the fish-shell function shown in other messages.
If I'm very much bored (which wouldn't happen in the near future), I might turn this glob command into a Homebrew package . . .