avatar
.cshrc?.login?.profile?# Unix - 噫吁兮,危乎高哉
b*g
1
Can somebody tell me how are these files used?
I have a shell command which I only want to execute
once when I login. Which of these files should I put
it in?
Thanks.
avatar
s*s
2
C shell, .cshrc
K shell, .profil

【在 b***g 的大作中提到】
: Can somebody tell me how are these files used?
: I have a shell command which I only want to execute
: once when I login. Which of these files should I put
: it in?
: Thanks.

avatar
t*e
3
should be .login for csh bah

【在 s***s 的大作中提到】
: C shell, .cshrc
: K shell, .profil

avatar
c*t
4
You should man csh/ksh/tcsh, depending on the shell
used. There, hit '/' key to do a search on 'FILE'.
That should immediately bring you to the files used.
Usually, the man page will tell you the exact order
of the files being processed.

【在 b***g 的大作中提到】
: Can somebody tell me how are these files used?
: I have a shell command which I only want to execute
: once when I login. Which of these files should I put
: it in?
: Thanks.

avatar
j*y
5
for csh, tcsh, .cshrc and .login are executed
for ksh, bsh, bash, .profile and .login are executed.
But I think bwang's question has some ambiguity. If he just wants to execute
some command once in one session, like xhost +font under an X environment,
then he shouldn't add entries in these startup files.
instead he should check what kind of session manager he is using and modify
the corresponding script, like .xsession and so on.

【在 c*****t 的大作中提到】
: You should man csh/ksh/tcsh, depending on the shell
: used. There, hit '/' key to do a search on 'FILE'.
: That should immediately bring you to the files used.
: Usually, the man page will tell you the exact order
: of the files being processed.

avatar
b*g
6
I am using tcsh, if I put the command in .login, it will be
executed every
time I open a new xterm window. But on the man page, it says
that tcsh will
invoke .login only if the shell is a login shell. ???

This is what I want, however, I don't have a .xsession file
under my home dir
I am using Iris6.5, do you know which file should I modify?

【在 j***y 的大作中提到】
: for csh, tcsh, .cshrc and .login are executed
: for ksh, bsh, bash, .profile and .login are executed.
: But I think bwang's question has some ambiguity. If he just wants to execute
: some command once in one session, like xhost +font under an X environment,
: then he shouldn't add entries in these startup files.
: instead he should check what kind of session manager he is using and modify
: the corresponding script, like .xsession and so on.

avatar
j*y
7

For Irix, everytime you open an xterm window, a login shell will be invoked,
so it will execute .login once more.
In theory, for irix6.5, you can add a file .sgisession under your home
directory, which will be executed only once for each session. But in practice,
sometime, it doesn't work at all.
So my way is still to add something in .cshrc or .login, but everytime I will
measure if it's first time to be executed.
say, if I only want to call xset +path once, then I add the following script,
se

【在 b***g 的大作中提到】
: I am using tcsh, if I put the command in .login, it will be
: executed every
: time I open a new xterm window. But on the man page, it says
: that tcsh will
: invoke .login only if the shell is a login shell. ???
:
: This is what I want, however, I don't have a .xsession file
: under my home dir
: I am using Iris6.5, do you know which file should I modify?

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