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 65fa7213 for ; Mon, 20 Jan 2020 08:17:21 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 481FD9C13B; Mon, 20 Jan 2020 18:17:20 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5780A9C0FD; Mon, 20 Jan 2020 18:16:05 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 77F919C0FD; Mon, 20 Jan 2020 18:16:02 +1000 (AEST) Received: from marmaro.de (marmaro.de [176.28.23.198]) by minnie.tuhs.org (Postfix) with ESMTP id CD0499BFE6 for ; Mon, 20 Jan 2020 18:15:57 +1000 (AEST) Received: by marmaro.de (masqmail 0.3.6-dev, from userid 1000) id 1itSE0-5Td-00 for ; Mon, 20 Jan 2020 09:15:56 +0100 To: tuhs@minnie.tuhs.org In-reply-to: References: Comments: In-reply-to Grant Taylor via TUHS message dated "Sun, 19 Jan 2020 14:22:29 -0700." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21056.1579508156.1@marmaro.de> Content-Transfer-Encoding: quoted-printable Date: Mon, 20 Jan 2020 09:15:56 +0100 From: markus schnalke Message-ID: <1itSE0-5Td-00@marmaro.de> 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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Hoi. [2020-01-19 14:22] Grant Taylor via TUHS > > Have you ever used shell level, $SHLVL, in your weekly ~> daily use of Un= ix? What's the use of it? The only use of $SHLVL I can think of is the answer to the question if ^D will close the last shell or just a sub shell. I hardly ever ask myself this question. Probably that starts to become relevant when you open sub shells frequently. > Someone also mentioned quickly starting a new sub-shell from the current = > shell for quick transient tasks, i.e. dc / bc, mount / cp / unmount, = > {,r,s}cp, etc., in an existing terminal window to avoid cluttering that = > first terminals history with the transient commands. With tmux or screen at hand, this use case is obsolete for me. (Besides, my shell doesn't know about $SHLVL.) This all pretty much depends on your working habits, of course. For instance, I never use history expansion but search the history frequently, thus additional entries in the shell history are no problem. I rather like to have all shell histories merged into one for having search access to all the commands I executed. This seems to be more of a modern shell usage concept. Job control, OTOH, I use a lot, to suspend the editor, grep for something, resume the editor, and the like. Which seems to be more of an older style usage concept. > That got me to wondering if there were other uses for shell level = > ($SHLVL). Hence my question. I'm interested as well, as I've got difficulties imagine these uses. One thing to clarify: Are you looking for uses of the shell variable $SHLVL or for uses of frequent sub shells? meillo