xxxxxxxxxx
# Declare a variable
my_var="Hello, World!"
# Print the value of the variable
echo $my_var
xxxxxxxxxx
#For storing and printing output at the same time do following:
OUTPUT=$(ls -1) #First assign output of command execution to a variable
echo "${OUTPUT}" #Then print out the result in variable into the terminal
xxxxxxxxxx
#!/bin/bash
echo
echo "When single quote is used with string:"
invitation='Welcome to javatpoint'
echo $invitation
echo
echo "When double quote is used with string:"
invitation="Welcome to javatpoint"
echo $invitation
echo
echo "When variable is used with double quote:"
Remark="Hello User!, $invitation"
echo $Remark
echo
echo "When variable is used with single quote:"
Remark='Hello User!, $invitation'
echo $Remark
echo