I'm struggling to fix the following shellcheck warning, because it would require nested quotes:
here=$(dirname $(realpath "$0" 2> /dev/null || grealpath "$0"))
^-- SC2046 (warning): Quote this to prevent word splitting.
How could I write this in a safe way with everything correctly quoted?