Folder Names with Apostrophe's

I am running Beets in a Docker container using the image linuxserver/beets:latest. I have not been able to find a way to escape an apostrophe in a folder name during an import.

I have tried $ & \ and many other things with no luck.

docker exec -u abc -it beets bash -c “beet import ‘/music/Jane’s Addiction’”
bash: -c: line 0: unexpected EOF while looking for matching `’’
bash: -c: line 1: syntax error: unexpected end of file

Hello! This is an issue with Docker and the shell rather than with beets per se. So you might try experimenting with just doing echo:

$ docker exec -it f0fd01477ab5 bash -c 'echo hi'
hi
$ docker exec -it f0fd01477ab5 bash -c 'echo import foo'
import foo
$ docker exec -it f0fd01477ab5 bash -c "echo import 'foo bar'"
import foo bar
$ docker exec -it f0fd01477ab5 bash -c "echo import 'foo \' bar'"
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
$ docker exec -it f0fd01477ab5 bash -c "echo import \"foo ' bar\"" 
import foo ' bar

I was able to get replacing a single quote in a folder name with ‘$’\047’’ to work this morning so that it reads the folder name correctly, but then it is not able to read the file name. It replaces the single quote in the file name with a question mark.

That’s probably a terminal encoding thing! That is, the filename is right but you can’t tell because some locale settings along the way do not support full Unicode output.