From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24861 invoked from network); 1 Sep 2021 19:57:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 19:57:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630526249; b=saZc2bklX6CyO23+squaiZiqZDuXFHdpq4XcMBFpGNEesXJMhYE19BC8nVL+skwf+O53TWCfBc rVRqCkv76bCfhaaf6Edh9uYLKv43T04JrmFTJeLrgchCh6PikCq6BjOa1xoovUJW6wdl6zooad awov/iYKu8XoXeLYdmFwqDVuoivkTN9AM0U3vUCjBaF54GoGdJ1njFitPq9QLUnjdiAzJCRbZv ZMEKe5aDMTjACOnDG9zXFsYLuNUJhlvXC4Yjejbsz8ondYfZJVBXx4q6UI06GSropRFNKtwazX RLc25JojXtAi1Us2lHFvVvOGBXkfreGHjZI617NLybHJCQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630526249; bh=BM1aNnSRNmdt7W+raJ2Y7JS5z+j6si5ScxbZ7vPdjyg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=AE585/xeNFAtzIphpJzbGev0SrQFoWjZSUHKksAYSsGZ+n+C+utlbZ1UKEAG/3pzmDgsSHREjp mFRs3txaUENncXROyRX3EFRbZMA0i4Im3hb0wsVHaCII+stoOoOyyN+bUijnxRcP73ZeoDuZGz FtrxmaeKe5lyf3M0la83aX6442tB4tozK/W5p77jS8lVWeK9ErvaagYej2K4bHh4plYLeYs6fU RrBc9HTJrwiinObDyb9saSCt9+gRfWn6h4slkC0MswhxiexHvD3U/KP/jkMd5Jd8EPdDDNHUYS ZQmwqjBzE1vgt0AMsnp5N0/UJaUHrUzUpsiytI3lZ62Izg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-transfer-encoding: Content-type:In-reply-to:MIME-version:Date:Message-id:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=z1if4GB6mxqtr0yvuGedkj8i1JW1Gu6PsFNC6rc3vLw=; b=birlclDGeAKOj0ekNVgPRmHirz Cn+jfP4fOpWnWBkkPlFUw6H0ry/0KldNeTe9XKf4FPdCb8CDKplF96pAn51GO1trWI0OhlPocn3LU 0+36et0b4xjabWd3i59alRJvJxhteItXOtS9/s+ZjeGRr11KbOEnjpPWDlotyIeapgpQqcdKRlqcB eqJ6dRH/Tww10Ba7Ew5mjkT4hzyGwzV+e8vOXYNzJLqA37EEsgpA14nA4Grjmjjp8LKbKqKLkhjRM eTOCt7fKzsOINtAu4d7v8epAB90/9PfbW5F0sc6BIy2E7LnlbCbP0ZWLSGSGepF2SrhK/jRNWue6e 9FBMs+Cg==; Received: from authenticated user by zero.zsh.org with local id 1mLWMS-0001FW-SV; Wed, 01 Sep 2021 19:57:28 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:34244) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1mLWLc-0000Wq-OD; Wed, 01 Sep 2021 19:56:37 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QYR00K5WPSQDAO0@mta02.eastlink.ca> for zsh-users@zsh.org; Wed, 01 Sep 2021 16:56:35 -0300 (ADT) Received: from [192.168.0.2] ([24.207.90.194]) by Eastlink with ESMTP id LWLbm765dVz4DLWLbmqvVo; Wed, 01 Sep 2021 16:56:35 -0300 X-Authority-Analysis: v=2.4 cv=c59u/Txl c=1 sm=1 tr=0 ts=612fdaf3 a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=XDTl0E0mAAAA:8 a=ejIzD3u-d0diLl-MjpkA:9 a=QEXdDO2ut3YA:10 a=6bVbWtCHWqfzfKgnKm6K:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgudegvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeifeetjefgvdeuueduhefhfedthfdvtddutdffueekleegfeevfffhfeelueefteenucffohhmrghinhepsggrvghlughunhhgrdgtohhmnecukfhppedvgedrvddtjedrledtrdduleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdeltddrudelgedphhgvlhhopegludelvddrudeikedrtddrvdgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: Best practices for managing aliases in ohmyzsh? To: zsh-users@zsh.org References: <41fa241f119fdb9b8598293aad345823@dondley.com> <776abe09c579095258b2eef28a7ad5ca@dondley.com> <1ee1545904fdc1b5f473460cddfe5000@dondley.com> <29064969-76d0-48a1-cb4a-719a9acaab29@eastlink.ca> <7248837b-fe22-4faa-8f2a-4e62973d5f91@www.fastmail.com> <7ed02d4d-a7b8-e457-f814-dc88e1cf5c35@eastlink.ca> From: Ray Andrews Message-id: <079751a8-0494-0432-d4b6-f8f3e6e3e2f9@eastlink.ca> Date: Wed, 1 Sep 2021 12:56:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 27059 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-09-01 12:16 p.m., Bart Schaefer wrote: > No, you're still misunderstanding (or making typos). A sourced script > DOES NOT create its own fresh environment, it affects the environment > of the program that sources it. > But ... don't I recall that a script runs in a separate process? Doing some quick looking (zsh is the same I trust): Bash scripts are not kept in the shell’s memory. *Whenever a script is executed, a new subshell (non-interactive shell) is forked to execute the script.* And within the subshell, the script is executed by the interpreter specified in the shebang line (for example, /#!/bin/bash/). But, if required, we can also execute the script within the current shell using the /source/ command. (think, think, think ... ) Ok, I was too flabby in interpreting 'execute'.  I've taken 'source' to be identical to 'execute'.  Not so.  But ... what if you have a shebang in a sourced file?  One might suppose that forces a subshell, no?  Everything I write has the shebang, I just put it there every time.  What if you source a file with another shell's shebang?  Possible paradox there.  It would *have* to run the other shell in a subshell unavoidably there -- or just barf.