Echo command difference between single quotation marks / double quotation marks / without quotation marks
No quotation marks: the string is output as is, and the variable will be replaced
Single quotation marks: the contents of the quotation marks will be displayed intact
Double quotes: the special symbols inside will be parsed and the variables will be replaced
Program:
#! / bin/bash
Echo "hello\ nworld" # "non-variable content, direct output
Echo-n "I LOVE YOU\ n ^ 3 ^" #-n means "" content is not escaped
Echo-e "YOU KNOW\ n I DO" #-e escapes "" content
Name= "1234" # defines a name string
Echo $name # output variable name content
Echo\ $name # directly output the content after "\"
Echo "$name" # "output variable name content
Output as is in echo'$name' #'
Run:
Hello\ nworld
I LOVE YOU\ n ^ 3 ^ You KNOW
I DO
1234
$name
1234
$name