The echo
command is a built-in command in most command-line interpreters, including the Bourne shell, the Bash shell, and the Windows Command Prompt. It is used to display a line of text on the screen.
When a string is double-quoted and preceded by a dollar sign ($
), it is called a "double-quoted string preceded by a dollar sign". This is a way to tell the command-line interpreter that the string is a variable, rather than a literal string.
For example, if the variable $var
contains the string Hello, world!
, the following command will display that string on the screen:
echo $"var"
This is different from simply using the echo
command without the dollar sign, like this:
echo "var"
In this case, the string "var"
will be displayed on the screen, rather than the contents of the $var
variable.