Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

csh startup scripts

Tags:

shell

csh

I know that csh has a lot of start-up files (.login, .cshrc, etc.). The problem is that I'm starting a new csh terminal and I'm seeing a lot of non-standard (not the standard ones like $HOME, $SHELL, etc.) environment variables set at start-up that I didn't set in any of my start-up scripts. Is there a way to figure out the sequence of files that get sourced at start-up in my current session. If not, is there even a facility that tells which script sets some environment variable given the variable's name?

like image 511
Haitham Gad Avatar asked Jul 22 '26 11:07

Haitham Gad


1 Answers

As mention Few options can help you. Together with "strace", they can help you identify which command file contributes

  • The '-l' mode will force "login" mode
  • The '-i' mdoe will force "interactive" mode
  • The '-V' will force verbose.

You can use the following to check startup sequence for the 4 combinations of login/interactive:

strace -eopen,close csh -V       -c "exit
strace -eopen,close csh -V -i    -c "exit"
strace -eopen,close csh -V -l    -c "exit"
strace -eopen,close csh -V -i -l -c "exit"

While this does not explicitly show which file contribute the environment variables, it's should provide you with good leads.

like image 63
dash-o Avatar answered Jul 24 '26 03:07

dash-o



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!