mdls does not work on mounted sparse bundles mdls does not return anything when I run it on a mounted (originally encrypted) sparse bundle:
❯ ll ./test
.rw-r--r--@ 0 evar 14 Sep 18:34 ./test

❯ mdls ./test                                                                                                               
./test: could not find ./test.

Trying mdutil to turn on the indexing:
❯ sudo mdutil -d /Volumes/sth                                                                                               
/System/Volumes/Data/Volumes/sth:
Error: unable to perform operation.  (-400)
    Error: unknown indexing state.

PS: I use mdls to extract the tags a file has. I'm open to using any other solution for doing so.
Using https://github.com/jdberry/tag works:
command tag --garrulous --list &quot;$file&quot; | gsed 1d