I want to learn about arrays and how to assign values to them, so I found this tutorial
While running the following script:
#!/bin/bash
$names=([0]="Bob" [1]="Peter" [20]="$USER" [21]="Big Bad John")
echo ${names[@]}
I get this error:
line 2: syntax error near unexpected token `[0]="Bob"'
line 2: `$names=([0]="Bob" [1]="Peter" [20]="$USER" [21]="Big Bad John")'
What am I doing wrong?
$
fromnames
. Not$names
butnames
– val0x00ff Apr 5 at 10:46