Duda con respecto a una variable de env.....

Posted October 23, 2021 96 views

como es la variable de env para saber el hostname?
es que en zsh* es $HOST pero en bash no me sale nada

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hey there!

In bash you should be able to use $hostname for the hostname env variable. To print it you can set it to a value like: testhost=$(hostname) then print it out using echo $testhost

You can also use the hostname command to print that out.

Hope it helps!