Making folders when the names have "/" and " ' "

Solution 1:

Single or double quotes will not cause any problems as long as you keep the variables properly quoted at all times.

$ title=$(cat << END_TITLE
This "is a title" with 'two kinds of quotes'
END_TITLE
)

$ declare -p title
declare -- title="This \"is a title\" with 'two kinds of quotes'"

$ mkdir "$title"      # no need to try to force extra quotes in here

$ echo $?
0

filenames may not contain a / character, no matter how hard you try to escape it. Slash is the directory separator. You'll have to substitute a different character. Suppose you choose -:

mkdir "$root_folder/${title//\//-} ($year)"

That uses bash's Shell Parameter Expansion instead of calling out to sed.