How do you display the value of a variable in UNIX?

How do you display the value of a variable in UNIX?
Answer
To Print the value of above variables, use echo command as shown below :
  1. # echo $HOME. # echo $USERNAME.
  2. $ cat myscript.
  3. #!/bin/bash. # display user information from the system. …
  4. $ echo “The cost of the item is $15” …
  5. $ echo “The cost of the item is $15” …
  6. var1=10. …
  7. $ cat test3. …
  8. Running the script produces the following output:
 

Tìm kiếm

Back
Top