How Do I Echo a Variable in Linux?
Contents How Do You Echo Variables in Linux? Declare a Variable and Echo Its Value. for Example, Declare a Variable of X and Assign Its Value=10. Note: the...
Contents
How do you echo variables in Linux?
Declare a variable and echo its value. For example, Declare a variable of x and assign its value=10. Note: The ‘-e’ option in Linux acts as interpretation of escaped characters that are backslashed.
…
echo Options.
| Options | Description |
|---|---|
| \ | backslash |
| n | new line |
| r | carriage return |
| t | horizontal tab |
How do you echo a variable in UNIX?
Now, using the echo command we can simply display its value on the terminal as follows:
- $ var_a=100. $ echo $var_a.
- $ var_b=” bash programming echo variable” $ echo $var_b.
- $ var_A=”hellofriends” $ var_B=50. $ echo $var_A$var_B.
- $ var1=$(date) $ var2=$(hostname) $ echo “the date is $var1 @ computer name is $var2”