Reputation: 25
I am trying to just run a simple bash command but i'm not sure what i'm misssing
#!/bin/bash
$person = Craig Baiey
echo $person
echo '$person'
echo "$person"
everytime I run it i get an error line 2: =: command not found
$person
Upvotes: 0
Views: 111
Reputation: 2677
Remove the $ before person on line 2:
#!/bin/bash
person="Craig Baiey"
echo $person
Upvotes: 0
Reputation: 785246
Space is the problem around =
. It should be:
person="Craig Baiey"
$
in name.btw this line won't print the variable's value:
echo '$person'
As shell won't expand it due to presence of single quotes. It will instead literal $person
Upvotes: 4