如何在 Solaris 中更改全局变量?

发布于 2025-01-03 11:23:37 字数 151 浏览 7 评论 0原文

我尝试使用以下命令更改 Solaris 中的全局变量 DSQUERY:

setenv DSQUERY "SYBSERVER"

但它没有保留。当我再次输入机器时,该值被设置为旧值。

我怎样才能坚持这个改变?

I've tried to change global variable DSQUERY in Solaris with this command:

setenv DSQUERY "SYBSERVER"

but it wasn't persisted. When I entered again in the machine the value was set to the older one.

How can I persist this change?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

勿忘初心 2025-01-10 11:23:37

您必须将此行放入您的配置文件中。当您启动 shell 时会读取此文件,并允许您设置一些特定设置。
文件名取决于您使用的 shell 以及连接方式(例如,使用直接连接或使用 su)。

看来您使用 csh,因此您必须更改 $HOME/.cshrc 和/或 $HOME/.login 文件。
将 SetEnv 命令添加到 .cshrc 和 .login 文件即可完成这项工作。

You have to put this line in your profile file. This file is read when you start a shell, and allows you to set-up some specific settings.
The filename depends on the shell you use and how you connect (with a direct connexion or with a su for example).

It seems you use csh, so you will have to change $HOME/.cshrc and.or $HOME/.login files.
Add your SetEnv command to .cshrc and .login file will do the job.

你的他你的她 2025-01-10 11:23:37

您必须在用户配置文件中执行此操作,具体取决于所使用的 shell(.login、.cshrc、.bashrc 等),以便当您再次登录时,它会自动执行。对于某些 shell,/etc 下有这些文件的全局版本,以防您希望将其应用于所有用户。

平均值,
丹尼尔

You have to do it in the user profile files, depending on the shell being used (.login, .cshrc, .bashrc, etc) so that when you log in again, it's executed automatically. There are global versions of those files under /etc for some shells, in case you want that to be applied to all users.

Rgds,
Daniel

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文