What's the difference between "and" in programming like MySQL and shells
2 answers
The MySQL
backlinks can be used to enclose table and column names that are reserved words, such as:
SELECT *
FROM `table`
The single quotes simply denote a string constant:
SELECT *
FROM `table`
WHERE `name` = 'test'
In wrappers, backticks allow the output of one command to be used as an argument to another command:
echo `date`
will execute date
and use its output as an argument for echo
.
Single quotes allow spaces, dollar signs, and backslashes within arguments:
echo '$HOSTNAME'
outputs the string $HOSTNAME
as it is,
echo $HOSTNAME
echo "$HOSTNAME"
both output the value of an environment variable HOSTNAME
.
+8
source to share