1) I have never seen a variable written with a hash (#) in front, so all I can assume is that the variables name is "#HOSTNAME" but I am probably totally wrong on this one...
2) Actually, this is running the "hostname" program with the value of "$HOSTNAME" as an argument. Variable assignment uses the equals sign ie: hostname=$HOSTNAME
3) Quoting the variable preserves whitespace when referencing it. ie:
Code:
hello="A B C D"
echo $hello
$ A B C D
echo "$hello"
$ A B C D
If you haven't already, checkout the Advanced BASH Scripting Guide, it has everything you want to know about BASH scripting and lots of example code.
http://www.tldp.org/LDP/abs/html/index.html