Closed nielsadb closed 8 months ago
Glob expansion is done by the shell, and it's an expected behavior. In order to avoid it, you can either enclose string in single quotes ('[test].torrent'
), or escape special symbols with backslash, as you do.
However, looking into the qbt version and the commands you posted, it seems that you are using some different tool, not the one in this repository.
qbt does not accept filenames containing square brackets, either using wildcard/glob or via a direct properly escaped name. See the code block below for details. It does work by adding quotes and escaping the square brackets manually. This is not what Unix shells like zsh do out of the box. I find it difficult to track down what's happening since the version I have installed (via Homebrew) seems slightly outdated compared to the sources on Github, but my guess is that qbt interprets the name as a glob pattern. A way to tell it explicitly it's a file, as described in the (outdated) documentation, might be helpful. (Note that on Unix, including MacOS, the shell typically does the expansion of glob-patterns, e.g.
echo *.torrent
executed in my test directory yields output[test].torrent
. This behavior is different on Windows, and maybe different between PowerShell and the oldcmd
)