From owner-freebsd-questions@FreeBSD.ORG Mon May 2 00:13:20 2011 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 CF644106564A for ; Mon, 2 May 2011 00:13:20 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 938F18FC08 for ; Mon, 2 May 2011 00:13:20 +0000 (UTC) Received: from r55.edvax.de (port-92-195-63-56.dynamic.qsc.de [92.195.63.56]) by mx01.qsc.de (Postfix) with ESMTP id D7B453CA4C; Mon, 2 May 2011 02:13:18 +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 p420DHon005025; Mon, 2 May 2011 02:13:17 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Mon, 2 May 2011 02:13:17 +0200 From: Polytropon To: George Sanders Message-Id: <20110502021317.af30339c.freebsd@edvax.de> In-Reply-To: <761855.57021.qm@web120004.mail.ne1.yahoo.com> References: <761855.57021.qm@web120004.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: Any way to have login output AND use rsync/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: Mon, 02 May 2011 00:13:20 -0000 On Sun, 1 May 2011 15:58:45 -0700 (PDT), George Sanders wrote: > I have my .cshrc file run some basic netstat and 'w' commands so that when I log > in, I can see at a glance what is going on on the system and notice any unusual > login activity, etc. > > However this completely breaks both scp and rsync - they cannot function at all > (apparently) with any kind of stdio output from the shell. > > Is there any way around this ? Create a file ~/.login and put your commands (in sh syntax, not csh) there. This file will only be executed at interactive logins. See "man csh", section FILES for details. > Is there some way to specify an alternate login shell when I use scp or rsync ? I'm sure the login shell has to be defined by the system, usually by the /etc/passwd file, field "shell"; therefore see "man 5 passwd". > Or conversely: > > Is there some way for my login shell (csh) to notice that it is scp or rsync > accessing the system, and skip the text output for them ? I don't think so, but it should work fine when you move the commands out of the shell configuration file (which is also read by script shells AND interactive shells) to the login startup file (which is only executed if the shell is an interactive login shell). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...