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.
Best Answer
Using https://github.com/jdberry/tag works:
command tag --garrulous --list "$file" | gsed 1d