Question: I'm newer to the scripting side of Bash. Receiving a syntax error on line 2. But, not sure what the issue is. Help is appreciated. Thanks!

```
#!/bin/bash

# Prints userlist, add users to system, add users to wheel group, and sets password.

userlist=(john mary dan jenna gary)
for i in {$userlist[@]}
do 
echo ${userlist[@]}
 sudo useradd ${userlist[@]}
 usermod -aG wheel ${userlist[@]}
 passwd ${userlist[@]}
done 

```

Answer: 
You have a typo:

```
for i in {$userlist[@]}

```

should be:

```
for i in ${userlist[@]}

```

Since `userlist` is an array, `$userlist` expands to the first element, `john`, so `{$userlist[@]}` becomes `{john[@]}` which isn't what you want, presumably.

Also, inside the for loop you should be using `$i` to reference each element in the `$userlist` array.
Wouldn't be this script easier ?

```
for i in john mary dan jenna gary
do 
echo $i
 sudo useradd $i
 usermod -aG wheel $i
 passwd $i
done 

```