How Do You Print a Variable in Unix Shell Script?
Contents

How do you print a variable in Shell?

Step # 2: Writing a Print Program in a Bash Script:

Type the program shown in the image below in your newly created Bash file. In this program, we are taking a number as input from the user and saving it in the variable num. Then we have used the echo command to print the value of this variable.

How do you print a variable in UNIX?

Sh, Ksh, or Bash shell user type the set command. Csh or Tcsh user type the printenv command.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest