Redian新闻
>
Shell Script Question about Hostname
avatar
Shell Script Question about Hostname# Unix - 噫吁兮,危乎高哉
j*n
1
Hi, everyone,
Can someone tell me how to tell which server I am running on
in the Korn Shell environment? Is there a Shell variable for
that, just like $LOGNAME can give you the username of
current user?
Need to perform different calculation on different server,
and do not want to write the script for them.
Thanks in advance.
avatar
q*e
2
you can use hostname, whoami to get your server name and
login user id.

【在 j***n 的大作中提到】
: Hi, everyone,
: Can someone tell me how to tell which server I am running on
: in the Korn Shell environment? Is there a Shell variable for
: that, just like $LOGNAME can give you the username of
: current user?
: Need to perform different calculation on different server,
: and do not want to write the script for them.
: Thanks in advance.

avatar
j*n
3
Thanks alot. hostname works.

【在 q***e 的大作中提到】
: you can use hostname, whoami to get your server name and
: login user id.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。