linux shell echo command with varia ble code example
Example 1: linux shell echo command with varia ble
echo “A is $var1 and B is $var2”
Example 2: bash echo in variable
#Just use following structure to store output of command into a variable:
var=$(command)
#For example:
var=$(echo 'hi') #store hi into var
var=$(ls) #store list of files into var