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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4998 invoked from network); 31 Aug 2021 21:46:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2021 21:46:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630446382; b=QKCNfsJ0jKns7LV3rtLkuoUH7ZeMNrUvocHdBujXethpAy659FBQRQGlFCKQDh3Rfu8bqMvbVz Dc0lGUakFXHYjyRiWNgABC//GJAXmfUXWBrfJ24HuLMo18fLYeJeDxLMzOnWfHwAxScXkDXQqI BPZJsojMmUDmevTz/pr/ZEVliuHKcyw7WOxsxD8nRKPlkS3xeDohdi3ksiX0Fu265PCseI56zi Z7xtkaiWshu713dshN4TiMSrytOSga+JYypoOZhEROlEApTtB5DCvcIjy3Z+CgKwGRuUhtrGxo h1h7vToMQ6UO4h6tE2lG3kR03TMiEFVkoweg1xtKEvFr9w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qk1-f178.google.com) smtp.remote-ip=209.85.222.178; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630446382; bh=x+gCPCSRIGwhvnIbMtGOBaQGFUMAXv5K10jHcfNaXNA=; 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=SvST1ZQJQlK+m2F3vUrZXzgJEXnM4Dyv4Uadg3TV1CLW2RXJawb+bqv7172cngt9e9vs6n3OIW LUox29uUbY62yGdn6jaozksKgvJJ82IER7rcaaa9zr3pL1rz5mcrwz0cWLL2FJS/zKZpuX6jy2 qlQD3Wj2jFaA69xkRCeTnaUhkr2nx8prhh/jN2EXgoNsU6gZAJQty5NJQymch/FDdP9nKUhnfQ Yx2+CvHUdx6gryAs0ur8kY7S5nUIEcSnfM0DIweZzPPVKEzEZwvsk93SQNF2mWgq8YOXYFQ6YP O+Yp09C+LrZLQGSFHfdPp1JKiWxZYoFZ/+Os0WjhVkrlGw==; 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=MHvxNxOEfBCGTf6O6bbRUL9mZGdg0/SJ/uv2Cgoh/d8=; b=mz8AXyVaEvvObUlPeYTyGKb6h8 zikL7+UYd35nJPaaD28grFJvJw1AX34qrglBCzgOIhpvzrIBUAt3z822ZlQsJ3b1iFP9BYpAVo/hC E0eboUh9oFC2UCd0XdObGSrtjVVQ/pP2OGybYeSDkzZ3O4brFfwZ4pW4Dz9hBveRSp7HZMbUMnF2D uSWGJ2oD3w9GKN6dWEYKsy8QsUl5JVJNB3ZmraehIDgTYiBiEo32+Uiyzs3+W6lawM4zWxLpBx0sP tC4UHRdrxFYizux5vGRKfrW5GpCBme54I4h0uePITVs66E0x1SB/xS+U/O7KZCX3Acq0uPPsZKVhE 7Jd/4yyQ==; Received: from authenticated user by zero.zsh.org with local id 1mLBaI-0007ps-Gw; Tue, 31 Aug 2021 21:46:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qk1-f178.google.com) smtp.remote-ip=209.85.222.178; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qk1-f178.google.com ([209.85.222.178]:47032) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mLBYU-0006jb-Me; Tue, 31 Aug 2021 21:44:31 +0000 Received: by mail-qk1-f178.google.com with SMTP id m21so872095qkm.13 for ; Tue, 31 Aug 2021 14:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHvxNxOEfBCGTf6O6bbRUL9mZGdg0/SJ/uv2Cgoh/d8=; b=SiBg5eQmWbFvf5vQFOxordC6CVxcM/7oIBJ994Gq12I2LXKY+QJhU2QHsk1jYGvRyP +6ClXL6O12c7gv7o9kdYisxRWSO0lHHT+zD7VIcUmPD2RFyT5BfKYSPIEUZD0OHH5fJv voRTNkgCtHfsLKcfEf57xqI0Hb2cpt8zjEedwKy2MspBhW/bcNz0nFuVSJaPrzT8vmnP dSScNKsxxiTGEXDdFbK8VenTgplyLh23igGhe0DrpygsdSlM2c0FesXkbidrPah2yROy wITXgac7WIqIRCygcNg25FXwFpUaRdOzXMQOOL3HGrR2KSkSN8//vL6w890tcxL3ZFFd sxHA== 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=MHvxNxOEfBCGTf6O6bbRUL9mZGdg0/SJ/uv2Cgoh/d8=; b=V8a1kfvv/PH6cl8IdVjJUMQfZrh+lD0QyW3he+hmL9qj+C6E1m9FukCGAU4sc/fGgc 35h2Fw6V7y+DBEjR4lF3N3D8H/l2wbbSG5r/XEPG8q1pUuhCjpHKzHiDyQuZUKTHJUM+ cmkzEYbVKjVJP8fguDLuEgwPocAazPHa2i1YshR+Oa/wcgVjozlSTycnBY11858b6PNQ A87skz/TAIetqx7j45muYDSTQBezQFwoqUrVVFmufB+mryysdssluIj65spXzrGED1m/ RuinZCqatma2wPfwDL7MJJqJx4CXRnw7lXs2VeYeQagbmQ5YbMsp0waXX9GxzyAA3R44 PT6A== X-Gm-Message-State: AOAM5308ycmkbYVYzDq4C9z53PaTBRfTwvmftm1KwFw+l/oGspvvbAUp tUEx3otYga+rpBnbyZjLEVZdsUd+OR3eLQTS+P0= X-Google-Smtp-Source: ABdhPJzf1AZxmDLPfWcnNNBK6CzX1+rezGhNVvRnbLH7EdcTOTkio4CRK2NVRIEiA8GBik7HlIg1er2hGQhMvdYrRf0= X-Received: by 2002:a05:620a:15b9:: with SMTP id f25mr5130983qkk.400.1630446269647; Tue, 31 Aug 2021 14:44:29 -0700 (PDT) MIME-Version: 1.0 References: <41fa241f119fdb9b8598293aad345823@dondley.com> <776abe09c579095258b2eef28a7ad5ca@dondley.com> <1ee1545904fdc1b5f473460cddfe5000@dondley.com> In-Reply-To: From: Roman Perepelitsa Date: Tue, 31 Aug 2021 23:44:18 +0200 Message-ID: Subject: Re: Best practices for managing aliases in ohmyzsh? To: Steve Dondley Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27036 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 11:23 PM Steve Dondley wrote: > > And so long as I only call these scripts > with an alias, there shouldn't be any performance penalty because they > won't all have to be sourced by zsh. Forgot to mention that there is no performance difference between invoking a script directly or via an alias. When you use an alias, it first gets expanded, and then the expansion is executed as if you typed it. For example: % alias foo=cat % foo When you hit ENTER after foo, zsh will realize that foo is an alias and will replace it with cat. After that it'll execute cat the same way as if you typed it yourself. Aliases are like (unhygienic) macros. When you execute an executable file -- be it a script or a binary file -- zsh never sources it. It uses execve(2) or something similar to execute the file. To source a file you need to explicitly run `source foo` or `. foo`. Roman.