From owner-freebsd-questions@freebsd.org Tue Dec 15 19:46:04 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4BFAA48A1D for ; Tue, 15 Dec 2015 19:46:04 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E556163C for ; Tue, 15 Dec 2015 19:46:03 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de (port-92-195-31-25.dynamic.qsc.de [92.195.31.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id D04FA27847; Tue, 15 Dec 2015 20:46:00 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id tBFJk1X3014884; Tue, 15 Dec 2015 20:46:01 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Tue, 15 Dec 2015 20:46:01 +0100 From: Polytropon To: Bertram Scharpf Cc: freebsd-questions@freebsd.org Subject: Re: freebsd-update editor choice Message-Id: <20151215204601.bd653269.freebsd@edvax.de> In-Reply-To: <20151215124601.GA4020@becker.bs.l> References: <20151213182848.M69104@brightstar.bomgardner.net> <20151215124601.GA4020@becker.bs.l> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 19:46:04 -0000 On Tue, 15 Dec 2015 13:46:01 +0100, Bertram Scharpf wrote: > Hi, > > On Sunday, 13. Dec 2015, 12:31:22 -0600, Gene wrote: > > I'm using freebsd-update to update my 10.1 system to 10.2. When merging files, > > it insists on using the 'vi' editor. I really, really, REALLY, despise vi. Is > > there a way to get it to use another editor? > > The problem I fussed about many times and long times without > any understanding up to this day is not how but _where_ to > set the EDITOR environment variable. There is > > - /etc/login.conf This will set environment variables globally for all users who login, not depending on the shell. There is also a user-level file ~/.login_conf which overrides settings made in the global file for a specific user upon login. > - /etc/rc Don't touch this file! :-) > - /etc/profile (and /etc/zprofile) This applies for sh and zsh globally. > - /etc/csh.cshrc (or /etc/zshrc) This is for the C shell. > - ~/.profile (and ~/.zprofile) This is the user-specific file for sh and zsh. It will override any settings made in the global files. It will be read if the shell is a login shell. > - ~/.shrc, ~/.cshrc, (or ~/.zshrc) Similar for sh, csh and zsh, except .shrc and .zshrc will be applied to interactive shells (which aren't neccessarily login shells). > - probably some more I forgot here For bash: .bash_profile, -bash_login, and .bashrc. > Some programs change their behaviour in dependence of the > EDITOR variable. For example if you log into a host with the > command > > $ ssh otherhost -t tmux > > most of the above files are left unregarded and the TMux > option 'status-keys' may be set to an undesired value. This depends on how login shells and interactive shells are being configured and how they inherit environmental variables. > Is there any documentation in which order and under which > circumstances the above files are executed or come into > respect? Yes. Those informations can be found in the manual pages of the respective shells ("man sh", "man csh", "man zsh", and "man bash"). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...