From nobody Fri Nov 17 19:41:41 2023 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SX6jT18zWz51JPH for ; Fri, 17 Nov 2023 19:41:49 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (tunnel82308-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:ccb::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "garrett.wollman.name", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SX6jS5Vj0z3R2d for ; Fri, 17 Nov 2023 19:41:48 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Authentication-Results: mx1.freebsd.org; none Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.17.1/8.17.1) with ESMTPS id 3AHJffQ7090901 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 17 Nov 2023 14:41:41 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.17.1/8.17.1/Submit) id 3AHJffxS090900; Fri, 17 Nov 2023 14:41:41 -0500 (EST) (envelope-from wollman) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <25943.49653.523313.53953@hergotha.csail.mit.edu> Date: Fri, 17 Nov 2023 14:41:41 -0500 From: Garrett Wollman To: mike tancsa Cc: FreeBSD-STABLE Mailing List Subject: csh to sh migration for root in RELENG_14 In-Reply-To: <6c6add3c-4a5e-4d84-9964-9a9448a36c95@sentex.net> References: <6c6add3c-4a5e-4d84-9964-9a9448a36c95@sentex.net> X-Mailer: VM 8.2.0b under 28.2 (amd64-portbld-freebsd13.2) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.4 (hergotha.csail.mit.edu [0.0.0.0]); Fri, 17 Nov 2023 14:41:42 -0500 (EST) X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED, HEADER_FROM_DIFFERENT_DOMAINS autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on hergotha.csail.mit.edu X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4SX6jS5Vj0z3R2d < said: > I am trying to bring my environment along from previous versions where > csh was the default shell and now trying to get used to sh. In the past > things like > sudo su > would pick up my settings in /root/.cshrc automatically. However, with > sh I have to do > sudo su -l root > Is there a way to configure it so I dont need the -l as part of the su > to get the same behavior ? See sh(1) section "Invocation", which describes how /bin/sh reads its initialization files, and in particular, that (as POSIX specifies) interactive non-login shells do not read any startup files unless the environment variable `ENV` is set. This is stupid but required by the standard. I would recommend changing root's shell to something that better suits your needs: either change it back to csh, or install the appropriate package and set it to bash or zsh, both of which read startup files for all interactive shells, not just login shells. -GAWollman