10

Error while reading from a file in shell script

view full story
linux-howto

http://www.unix.com – Hi All, I'm writing a script to read a file line by line and then perform awk function on it. I am getting an error . My file has one name in it "James". I'm expecting my o/p to be youareJamesbond James ./users.sh: line 7: =: command not found Code: #script to read file line by line #adding quotes at start and end of users #!/usr/bin/bash while read line     do echo $line       $username=$(awk '{print "youare" $line "bond"}')       echo $username done</home/gunner/users.txt echo $username (HowTos)