Skip to content

Files

Latest commit

 

History

History
29 lines (17 loc) · 587 Bytes

SC2088.md

File metadata and controls

29 lines (17 loc) · 587 Bytes

Pattern: Use of ~ in quotes

Issue: -

Description

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".

Example of incorrect code:

rm "~/Desktop/$filename"

Example of correct code:

rm "$HOME/Desktop/$filename"

Exceptions

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

Further Reading