SC2088 – ShellCheck Wiki

See this page on GitHub


Tilde does not expand in quotes. Use $HOME.

Problematic code:

rm "~/Desktop/$filename"

Correct code:

rm "$HOME/Desktop/$filename"


Tilde does not expand to the user's home directory when it's single or double quoted. Use double quotes and $HOME instead.

Alternatively, the ~/ can be left unquoted, as in rm ~/"Desktop/$filename".


If you don't want the tilde to be expanded, you can ignore this message.

ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.