From owner-freebsd-newbies Sat Apr 6 14: 7:52 2002 Delivered-To: freebsd-newbies@freebsd.org Received: from Amelia.bsdprophet.org (cherry46.theshop.net [63.67.33.111]) by hub.freebsd.org (Postfix) with ESMTP id 2FF8137B404 for ; Sat, 6 Apr 2002 14:07:48 -0800 (PST) Received: from Amelia.bsdprophet.org (localhost.bsdprophet.org [127.0.0.1]) by Amelia.bsdprophet.org (8.12.2/8.12.2) with ESMTP id g36M8awp046843; Sat, 6 Apr 2002 16:08:36 -0600 (CST) (envelope-from scott@Amelia.bsdprophet.org) Received: (from scott@localhost) by Amelia.bsdprophet.org (8.12.2/8.12.2/Submit) id g36M8abL046842; Sat, 6 Apr 2002 16:08:36 -0600 (CST) Date: Sat, 6 Apr 2002 16:08:35 -0600 From: Scott Corey To: dillama Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: Difference between .cshrc and .profiles Message-ID: <20020406220835.GA46758@bsdprophet.org> Mail-Followup-To: Scott Corey , dillama , freebsd-newbies@FreeBSD.ORG References: <20020406202704.36C06B6B6@xmxpita.excite.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020406202704.36C06B6B6@xmxpita.excite.com> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org As a normal login shell, bash 'sources' system-wide file /etc/profile, whrer the system environment and path can be set for bash users. However, it is not run when the system interprets the shell as non-interactive. The most important case would be single user mode, where csh is executed on the machine. The /etc/profile is not run and the path is inherited from the csh daemon. bash receives command line arguments -login and -i that can be used to set as a login shell or interactive shell respectively. The user can overwrite values set in /etc/profile by creating a file ~/.bash_profile, ~/bash_login or ~/.profile. Note that just the first one of these is executed thus differing of the logic of csh initialization. ~/bash_login is not executed specially for login shells and if .bash_profile exists, it is not executed at all! If bash is used with name sh instead of the name bash, it emulates original Bourne shell initialization: it sources just files /etc/profile and ~/.profile and just for login shells. As a login shell tcsh executes the following files in this order: /etc/csh.cshrc /etc/csh.login ~/.tschrc ~/.cshrc (if .tschrc is not found) ~/.history ~/.login ~/.cshdirs tsch can be compiled to execute login scripts before cshrc scripts. Beware! Non-interactive shells execute just the "cshrc scripts" login scripts can be used to set the path just once in the login. Hope this helps. On Sat, Apr 06, 2002 at 03:27:04PM -0500, dillama wrote: > > Can anyone explain the difference between .cshrc and .profile? They are so similar. > > > > ------------------------------------------------ > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-newbies" in the body of the message -- Scott B. Corey scott@bsdprophet.org irc.openprojects.net #bsdprophet To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message