mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC1066 (markdown)
11
SC1066.md
11
SC1066.md
@@ -20,10 +20,19 @@ declare "$name=hello world"
|
||||
echo "$foo"
|
||||
```
|
||||
|
||||
Or if you actually wanted to compare the value, use a test expression:
|
||||
|
||||
```sh
|
||||
if [ "$greeting" = "hello world" ]
|
||||
then
|
||||
echo "Programmer, I presume?"
|
||||
fi
|
||||
```
|
||||
|
||||
### Rationale:
|
||||
|
||||
Unlike Perl or PHP, `$` is not used when assigning to a variable.
|
||||
|
||||
### Exceptions
|
||||
|
||||
None
|
||||
If you wanted to
|
||||
|
Reference in New Issue
Block a user