Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux echo variable value

# Example:
MY_VAR=a    # here you assigned the value 'a' to MY_VAR
echo $MY_VAR
echo MY_VAR
# output:
a
MY_VAR
# good practice says to name variable in all caps to differ from commands
# if you want to print to print to console the value of MY_VAR, you must use $
# if you echo without using $, the name of the variable will be printed
# not the value
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #linux #echo #variable
ADD COMMENT
Topic
Name
9+3 =