From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 3f631bb3 for ; Tue, 21 Jan 2020 23:11:39 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 9DD4A9C20A; Wed, 22 Jan 2020 09:11:38 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 7A2EC9C1FF; Wed, 22 Jan 2020 09:10:35 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 939A19C1FF; Wed, 22 Jan 2020 09:10:32 +1000 (AEST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by minnie.tuhs.org (Postfix) with ESMTPS id ABD299C14A for ; Wed, 22 Jan 2020 09:10:27 +1000 (AEST) Received: from callcc.thunk.org (rrcs-67-53-201-206.west.biz.rr.com [67.53.201.206]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 00LNAN7b032082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jan 2020 18:10:26 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 2B1B5420057; Tue, 21 Jan 2020 18:10:23 -0500 (EST) Date: Tue, 21 Jan 2020 18:10:23 -0500 From: "Theodore Y. Ts'o" To: Grant Taylor Message-ID: <20200121231023.GM15860@mit.edu> References: <1itSE0-5Td-00@marmaro.de> <20200120194057.GI15860@mit.edu> <75e10412-9719-c950-a808-19bc0a101f5a@spamtrap.tnetconsulting.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75e10412-9719-c950-a808-19bc0a101f5a@spamtrap.tnetconsulting.net> Subject: Re: [TUHS] Shell Level... X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@minnie.tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Tue, Jan 21, 2020 at 01:44:07PM -0700, Grant Taylor via TUHS wrote: > On 1/20/20 12:40 PM, Theodore Y. Ts'o wrote: > > The normal reason why I'm starting subshells is because I need to > > control various environment variables on an ad-hoc basis. It might be > > PYTHONPATH, KRB5CCNAME, GPG_AGENT_INFO, LD_LIBRARY_PATH, or some > > combination of the above. Back when I was regularly using Kerberos > > root/admin bits, I had some hard-coded shell aliases to indicate > > explicitly I was in a shell that was using my tytso/root@ATHENA.MIT.EDU > > or tytso/admin@ATHENA.MIT.EDU kerberos tickets. > > If I'm understanding you correctly, you used a sub-shell with a modified / > task / process specific environment. Correct? Correct. And I would often suspend the shell when I didn't need to use the Kerberos administration credentials, and then go back to it later when I did need it, and since I was often bouncing back and forth between the sub-shell and the parent shell, having the SHLVL displayed in the prompt for non-top-level shells was useful. For similar reasons, my shell prompt will also display what git branch I happen to be one. For example: {/usr/projects/e2fsprogs/e2fsprogs-maint}, level 2 (debian/master) 1001% Says that I'm on the debian/master git branch, and "level 2" indicates that I'm in a subshell. (If I'm in a top level shell, no level will be printed at all.) The prompt also displays the hostname ("lambda" in this case") which is super-useful to identify remote logins. - Ted