Quote `grep` pattern

Thanks to <http://www.shellcheck.net/> for the tip.
Use tilde to point to home directory

Thanks to <http://www.shellcheck.net/> for the tip.
Quote non-glob string

Thanks to <http://www.shellcheck.net/> for the tip.
Use modern command substitutions syntax

Thanks to <http://www.shellcheck.net/> for the tip.
Use More Quotes™

Thanks to <http://www.shellcheck.net/> for the tip.