PRICE_PER_APPLE=5
echo "The price of an Apple today is: \$HK $PRICE_PER_APPLE"
Why the dollar sign and backslash is used in the argument?
What is the meaning of sha-bang !#?
And what does it do the bash script can you me the best example to easy get understanding of it?
$HKin double quotes would be expanded to the value of the variable$HK. By preceding it with a backslash, you escape the expansion, so the literal string$HKis echoed (probably meaning Hong Kong Dollars).There's no "sha-bang" in your example. It's usually spelt "shebang" and it contains the characters you mentioned in the reversed order. It tells the system what interpreter to use to run the script. For example,
will be interpreted by
/bin/bash, whilewill be interpreted by
/usr/bin/sed.