-
Notifications
You must be signed in to change notification settings - Fork 1.9k
SC1000
koalaman edited this page Nov 10, 2013
·
7 revisions
echo "$"
echo "\$"
$ is special in double quotes, but there are some cases where it's interpreted literally:
- Following a backslash:
echo "\$" - In a context where the shell can't make sense of it, such as at the end of the string, (
"foo$") or before some constructs ("$'foo'").
To avoid relying on strange and shell specific behavior, any $ intended to be literal should be escaped with a backslash.