The two are not equivalent. In a line that contains `$(foo)`, the `$(foo)` is replaced with the output of the command `foo`. For example:

```
$ echo "hello $(echo world)"
hello world
```

In a line that contains `$foo`, the `$foo` is replaced with the value of the variable named `foo`. For example:

```

$ foo=world
$ echo "hello $foo"
hello world
```