/dev/null || grealpa" /> /dev/null || grealpa" /> /dev/null || grealpa"/>

How to quote a shell command containing a quote

62 Views Asked by At

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?

0

There are 0 best solutions below