LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-22-2007, 09:20 PM   #1
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,428

Rep: Reputation: 83
tcsh; Which file is systemwide startup one?


Hya,

I use tcsh for my user account on my Debian penguins. (bash for admin)

I am wondering where tcsh sets up system wide "path"?

/etc/cshrc has several lines (bindkey, set autoexpand...), none of them sets up path.
/etc/login executes files in /etc/csh/login.d, but this directory is empty (so nothing is done).

Neither my ~/.tcshrc nor ~/login set up "path.

I know that /etc/profile exists and that it sets up path, but I guess it is for bash.

I need to setup system wide path, I just do not want to screw up my penguins. Also, I am a kind of curious.

Happy Penguins!
 
Old 11-23-2007, 07:08 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,740

Rep: Reputation: 298Reputation: 298Reputation: 298
This should help: http://www.linuxheadquarters.com/howto/basic/path.shtml
 
Old 11-23-2007, 09:31 AM   #3
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,428

Original Poster
Rep: Reputation: 83
Thanks for your reply.

However, that link does not say where system wide path is defined in tcsh either.

My question #1 might not have clear enough, so I just rephrase.
When my tcsh starts, I have my path, (/usr/bin, /usr/local/bin....) I want to know which file defines these path. (So far, I have not found in following files, /etc/cshrc, /etc/csh.login, ~/.tcshrc and ~/login)

Happy Penguins!
 
Old 11-24-2007, 03:41 AM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,740

Rep: Reputation: 298Reputation: 298Reputation: 298
The file is /etc/csh.cshrc.
 
Old 11-25-2007, 09:14 AM   #5
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,428

Original Poster
Rep: Reputation: 83
Hya,

Aiya, it was typo. I already checked /etc/etc.cshrc (not /etc/cshrc).

So far, I have found that
1: tcsh under Solaris sets up initial path in /etc/etc.cshrc
2: login package looks like to set up path under Debian (because /etc/login.defs looks like to have initial path.) But how?

Happy Penguins!
 
Old 11-25-2007, 09:58 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Check if your distro has an /etc/profile.d/ directory. It may contain system wide startup scripts for various types of shells.

Also from the manpage:
Code:
   Startup and shutdown
       A  login  shell  begins  by  executing  commands  from the system files
       /etc/csh.cshrc and /etc/csh.login.   It  then  executes  commands  from
       files  in  the  user's  home  directory:  first  ~/.tcshrc  (+)  or, if
       ~/.tcshrc is not found, ~/.cshrc, then ~/.history (or the value of  the
       histfile shell variable), then ~/.login, and finally ~/.cshdirs (or the
       value of  the  dirsfile  shell  variable)  (+).   The  shell  may  read
       /etc/csh.login  before  instead  of  after /etc/csh.cshrc, and ~/.login
       before instead of after ~/.tcshrc or ~/.cshrc  and  ~/.history,  if  so
       compiled; see the version shell variable. (+)

       Non-login  shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc on
       startup.

       For examples of startup  files,  please  consult  http://tcshrc.source‐
       forge.net.
Often a distro will have the main startup script source other scripts. It is common for there to be an .aliases script somewhere. Read through the /etc/csh.cshrc and /etc/csh.login scripts and see if any others are sourced. It is also possible that the PATH environmental variable is inherited from the system's environment when you log in. If that is the case, the paths could be set up in an /etc/profile script or even in the initrd's linuxrc or init script.

Also, different scripts may add to path. So there may not be a single place to look.
 
Old 11-26-2007, 08:18 PM   #7
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie
Posts: 1,428

Original Poster
Rep: Reputation: 83
Hya,

Thanks.

Now, I know that system environment defines path.

Even, bash (which OVERWRITEs system environment), tcsh as well, obey login.defs file, on my Debina Penguin.

I am curious how it works, but I still do not know (none of rc files look like)

Happy Penguins!
 
  


Reply

Tags
rc, startup, tcsh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting alias file to from solaris to linux tcsh chrisrose21117 Linux - Newbie 2 09-27-2007 12:31 PM
Cronjob not firing off on debian systemwide cron rsvirani Debian 4 11-07-2006 06:59 AM
tcsh script, replace word in file true_atlantis Programming 10 02-17-2006 01:24 PM
systemwide sound troubles iceman47 Linux - Software 1 09-06-2003 08:02 PM
systemwide bash login shell cleanup file markus1982 Linux - General 2 05-10-2003 08:35 AM


All times are GMT -5. The time now is 03:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration