I was in an interview today. They asked me to name the command used for priting the value of a variable into the console.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

answered by (171 points)
selected by
0 votes
Best answer

You can use echo command for the same as given below.


e.g. Variable var1 contains value "Hello world"


you may print it like

for linux / mac

$ echo $var1

in case of Windows

> echo %var1%


Hope it helps.