From owner-freebsd-questions@FreeBSD.ORG Wed Jun 9 00:29:49 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F9711065673 for ; Wed, 9 Jun 2010 00:29:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 510CB8FC0C for ; Wed, 9 Jun 2010 00:29:49 +0000 (UTC) Received: from r55.edvax.de (port-92-195-117-232.dynamic.qsc.de [92.195.117.232]) by mx02.qsc.de (Postfix) with ESMTP id 2C8741E379; Wed, 9 Jun 2010 02:29:46 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id o590TjP1003704; Wed, 9 Jun 2010 02:29:46 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 9 Jun 2010 02:29:45 +0200 From: Polytropon To: Goh Sanda Message-Id: <20100609022945.ffe09ab5.freebsd@edvax.de> In-Reply-To: <101691.53333.qm@web120207.mail.ne1.yahoo.com> References: <101691.53333.qm@web120207.mail.ne1.yahoo.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: adding output lines to my .cshrc breaks sftp and scp ... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 00:29:49 -0000 On Tue, 8 Jun 2010 16:41:54 -0700 (PDT), Goh Sanda wrote: > > > I added a few lines to the bottom of my standard FreeBSD .cshrc file: > > echo "" > w > echo "" > > Just to show me what is going on each time I log in. Use ~/.login for command that should be executed after you log in. The corresponding system-wide file is /etc/csh.login. > I don't understand why .cshrc output is breaking non-interactive > SSH file transfer. Because .cshrc is read (and that's why "executed") every time a shell is requested. > Is there a way to customize my .cshrc output while still retaining > scp/sftp functionality ? Simply use ~/.cshrc for settings, and ~/.login for "real" commands. A better explaination can be found in "man csh", let me quote: 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. Commands like stty(1) and tset(1), which need be run only once per login, usually go in one's ~/.login file. Users who need to use the same set of files with both csh(1) and tcsh can have only a ~/.cshrc which checks for the existence of the tcsh shell variable (q.v.) before using tcsh-specific commands, or can have both a ~/.cshrc and a ~/.tcshrc which sources (see the builtin command) ~/.cshrc. The rest of this manual uses `~/.tcshrc' to mean `~/.tcshrc or, if ~/.tcshrc is not found, ~/.cshrc'. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...