Q: SH file not executing successfully I am new in linux. Trying to run sh file which connects the server over FTP or VSFTPD and get some files. Here is my Script
#!/bin/sh
HOST='IP_ADDR'
USER = 'user'
PASS = 'password'

FILE = 'path/filename.txt'

ftp -n $HOST <<END_SCROPT
quote USER $USER
quote PASS $PASS
get $FILE

quit 
END_SCRipt
exit 0

When i try to run this file: sh file.sh
it throws error:
file.sh: 3: file.sh: HOST: not found
file.sh: 4: file.sh: USER: not found
file.sh: 5: file.sh: PASS: not found
file.sh: 7: file.sh: FILE: not found
Not Connected.
Not Connected.
Not Connected.


A: Remove Spaces between variable and its value.
USER='user'
PASS='password'
FILE='path/filename.txt'

Assignment in bash scripts cannot have spaces around the =
For more understand = also is compare operator. see this example:
if [ "$a" = "$b" ]

  Note the whitespace framing the =. In this case we are comparing "$a" and "$b".
if [ "$a"="$b" ] is not equivalent to the above.

Testing with example:
kasiay@kasiyaPC~:$ a=2
kasiay@kasiyaPC~:$ b=3

Then we run if [ "$a" = "$b" ]; then     echo "equal"; else    echo "not equal"; fi, the result will "not equal" and it's true result.
But if we run if [ "$a"="$b" ]; then     echo "equal"; else    echo "not equal"; fi, the result will "equal" and it's wrong result!!
Why in this case we are wrong result?
When we are using if [ "$a"="$b" ], it parsing as if [ A_TOKEN ], then in this case the if condition always return true result. for example:
if [ "$a"="$b" ]; then    echo "TRUE"; fi
#result is TRUE

if [ 2=3 ]; then    echo "TRUE"; fi
#result is TRUE    

if [ anything ]; then    echo "TRUE"; fi
#result is TRUE

And finally when you are using USER = 'user' (I don't know which section parse this), then you are getting "not found" . and Why is "not found"?? since the parser looking for value of USER variable to compare with 'user' value. and it's "not found" right? 
