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=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7217 invoked from network); 1 Sep 2021 03:02:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 03:02:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630465364; b=p5knM7Nl2L8LJIVWhEYsfTT8p+TNImuhkrZpvf6CsQZWOHzpJYCCgIiNRrm/xS7DPWpQNAvAJb iU0rhKps2cOEdK5qcfpvMuQDQEd7Q7SkfAjCTSsy8uHl4icZ74FHkErqyfqnF9qg2SELbdoG1Y tYRI82sJAY5/ZWcHUJ6Dhp0h4PBmak/+7iixqnF2BAdTGBJZepSFEyLZqI5GkeFNLtF2jbyZje Ach8kzQ0xIz+OyZsWi8stJzFkohkdi5COlrwBJLdu7lIXgrL6bNx80BWttdbnARhPy6dxKSESV Ji/b9nnCtC7oOP1WvzBsTnKlDQ8xuaIGgAXiQjk957jd7A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630465364; bh=mPAEsjcuMjufqZv8PB4mxR+iAAyGskbVC9t72H+h0Hg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=spaXYx2pbh4q2FNAPC/ysuE0mCSWCu8D4zVRmtRUDYggf2JMqeBMPJcm0Gnl0uqainbOh+DWje MrfWG6bEKur0z90LpZnE/0falQqHi1f/kjY2IJb84u4cD2l6YkqVa+kIXmVq8ExBlqzrlwJzim W2bGzjsmSKd8y1sTWgHdG2MT+3yEyzgQGsQN2Kv1aSu03HJQ2rk+PsXfK05RMVT9m8pvfMjbFQ M8vs1l1erq+gluMf/lRVCCbulVo1xckkKhWLKSxtgo8WEi0TCXKf3lRDz5Gn1Dr0g953yEvCbj 0frsgfIF4msQkqzAtgN75nKWQxuXRiSpq+Ue8abDr6INJA==; 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-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=HNn4yfoVXvEKZYpP17YpytZfFUrGl9DwffD2acVDgLU=; b=jZ3rGQ3YcniSo1LhbcmULB4IXg SibPSQDmcCRnpco552jDOuYyTeRvCZjpafo73d5meQT91Ml/CekGRULjg+8E8BlGncMzzsZVoX0r8 TxlZQ+6NjPWY2JJPCU/ULkSy0rJBI9jFYuJ0qhOagyzRYxC3XcsgneOGkPnzTGVn2vbdZFtyNVISE +GCRg5+ajurU/dGBjtbGzy7cfFh2jVo1Qmh8i+mAY0g9MaU1hmqS05vLHjhF+8wcK87z7p+J5jLhz HEZKDARv00IB+SL4HzAw7LL3Cy8qazTEwPIrM8vF1sw1F+zGoG4qNVMm13++65dgDOk6KINsOJnhD tRd9Pd8Q==; Received: from authenticated user by zero.zsh.org with local id 1mLGWQ-00017W-PB; Wed, 01 Sep 2021 03:02:42 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f180.google.com) smtp.remote-ip=209.85.219.180; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f180.google.com ([209.85.219.180]:38500) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mLGVG-0000Kd-JT; Wed, 01 Sep 2021 03:01:31 +0000 Received: by mail-yb1-f180.google.com with SMTP id f4so2379265ybr.5 for ; Tue, 31 Aug 2021 20:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HNn4yfoVXvEKZYpP17YpytZfFUrGl9DwffD2acVDgLU=; b=ZJ48kcypjGR0aDBljWUz3BdQCziqu6qOcAcFQ1ClW1O1rCTJmgENq/E8uvgGDZ7MI8 QF6VepojsiFavTJhYzrx7Oml6rWhwz/JvklZdTVC8+i+W/OZV03lZfM2yG2qa1R9xmtQ xq4oc9SeQD3c/yJA921WbEbbamoxslKTC2h6g7+81yy0+RjOvoNjYJOtJQyJ+s+1EuNU ATGzNvCN5hWUsyH3SvvnNqIk5SlKDSfq8hGDoT6mBL9pEh+zE7diVXQa34DGz/wq2b3y p01ZJq+v/RzjJQekVqIeGRFzFvL4SFRXwYXu5PJj/d60dLCVgn8Dgr45KYP3vZjyR+pm jeyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HNn4yfoVXvEKZYpP17YpytZfFUrGl9DwffD2acVDgLU=; b=cveyAcANA0aqULmZh4nlhlT92GfyGTgvrAxXnk4mEAdCOsmaO189u/0Mbr5x+sfzzH h6fyaWx/3PVE1n+QBW+QMwgug2UUpS0yStqDXa9VZquMm8yWWIlMqqWsdYY+7kqgi2Pb 2t07qixpI0XoxFl1TFp6t/8tj/UkYYR9Td1sM4FNK7b8R2DmHCH/L6W3rGBDgRCQh96I r06CC1unJx22GmataB/YA41SgCXF0KoOIiLrVXb3DACyEMUq2MN1N/HcWe0Q8xB+mPOI jQgB7X67kqK8YRKNBAdKCP5f7Kho9dgGP1mhsbVWZKKaIkIvVGJAmpLcJlSoA2PfK31v gQMA== X-Gm-Message-State: AOAM531JTQixDRXx7Ii3qLd+UvqkgpDBuPxd63rTcKWTXQ2RGS5slEeO SRTQgeAjVz4937WvFi4DR8AfljDI5GoDJQmPuvWcvg== X-Google-Smtp-Source: ABdhPJwLMvbFQ9ER6JWsCoNSofsttHZx/7LCwKMANFOuEtbt21WCvCs6nle6OjGJKrRXW+trhNx5ATQndyMdI3w/lLY= X-Received: by 2002:a25:290:: with SMTP id 138mr34651220ybc.226.1630465289482; Tue, 31 Aug 2021 20:01:29 -0700 (PDT) MIME-Version: 1.0 References: <41fa241f119fdb9b8598293aad345823@dondley.com> <776abe09c579095258b2eef28a7ad5ca@dondley.com> <1ee1545904fdc1b5f473460cddfe5000@dondley.com> <29064969-76d0-48a1-cb4a-719a9acaab29@eastlink.ca> In-Reply-To: <29064969-76d0-48a1-cb4a-719a9acaab29@eastlink.ca> From: Bart Schaefer Date: Tue, 31 Aug 2021 20:01:18 -0700 Message-ID: Subject: Re: Best practices for managing aliases in ohmyzsh? To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27041 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 Tue, Aug 31, 2021 at 7:33 PM Ray Andrews wrote: > > Yikes, I'm missing something fundamental. In my head, executing a > script is identical to sourcing it. It's not a binary, so what else can > there be than interpreting the file? The file typically names the interpreter that will understand it. That's the point of the shebang (#!) line at the top of the file. Thus you can have zsh scripts, bash scripts, perl scripts, python scripts, etc. and the shell (or some other program) that wants to run the script doesn't have to be the same one that understands the scripts. It just says "execute this" and the operating system looks at the #! and starts up (a new invocation of) the correct program. That new copy "sources" the file. The context of the discussion has been (1) how to zsh interactively but run scripts written for bash, without having to convert them, and (2) how to make all those scripts accessible to zsh without having to predefine them somehow in .zshrc. The answer is to make them executable and put bash in the #! line, so that bash continues to be what runs them. That works as long as what the script does, does not need to persist in the interactive zsh (see "new invocation" above).