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 4029 invoked from network); 31 Aug 2021 21:36:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2021 21:36:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630445819; b=TB+Ba4MnKM2dRxM+Ijs26/v3W4rdSkwxxfSaxNvfQHXAGswqQffCfVTHxVW3+uPTZMeyE4Adz3 GRlUIJJjE9OpVcbLwhTdZ4gtkQg1nMOI6BrmatpauWJQciiG7kdKA/ZsEpUZ2n3Ydf1srzaI/j 3O/4xMyS5sFIConqlxWmv557n0iTvI0mdbjwHfvvu+88889yD7IET0Xc4fDH5QMfuSXUF1mqO5 xXYuGPkfrNGgKNRC6DzBWh8QV/EdZAwVpYys7+3gwcY0hkfVOpGakikykKcg3cRLg7BeZxz0hJ RYet0wv/EXuSomzsG63gHnI4LFGAjece5Geg9p0Uz6EGzQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qv1-f51.google.com) smtp.remote-ip=209.85.219.51; 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=1630445819; bh=spvqfJEoS6ypgI4yWL4CciD0Qpi90mJScsA7XXPjWs4=; 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=n7tgq9G6vACkY361NiHkMHJJ1Nnd7QYf8AGLqECqaKExCMxh93J5CNTxGt1fzAkBRD9QSwwhVX im7axgyByhi9wXzygj5J46KfF5NcxSiQIjXnRS6oIv7de0yjjJicFpyipp11hcTq8G7TuEAh09 EmdgwiWquyXnM0ZQMJ06qq2M025/4XZki5FE0w7y6NWEK65PP1iLfuIDbpTMIlVQOAB/JxJhV0 Iqw7B4R2FQwikoXe4jFYfY0XLUYJdwESnlFC3/HtEswMObli807MbV+fkWGZ1YJ8O6KE7pt2ic fb/IGcFiJusUnjl76c6VUcv/l7wKkPP6d2iUoBNpbQj2BQ==; 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=Ctg0uU0ZKLrK8MGeOhA4wUoiuKcZhmadHnZfrQyBB08=; b=QKSJSjpQTrNfx+1Hp9WAXVN4+T 8q78DrmPja9nAy4diQvp9vNFHfed1AEQb0FsV6Xfg79zf6EPAAkxW9lSXR3W7scDvRHzgOeMHnwoy C9BE1razk6KMzGG/6qzvZR5cYbpwb1KJEyLrN7jEsVCnyi0IM3P0XL4sqgThItSGcf6ETBzuuzAze FMHtAqJLVX3J6eEP7FelHnszeTQq79LwK+GBT2AWOhrAwiG0jz3817JqiPnaNMpu+HeyenCo8dvib 60RUUYa1pxoIM52XZCEcu236ITjddrUat1HWR7zU1rlQ+vLZtopD8Z+gj39bSIvwRpM+MkqxUDbEm dd28D/dA==; Received: from authenticated user by zero.zsh.org with local id 1mLBRC-00055T-SH; Tue, 31 Aug 2021 21:36:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qv1-f51.google.com) smtp.remote-ip=209.85.219.51; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qv1-f51.google.com ([209.85.219.51]:34712) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mLBQb-0004N9-OV; Tue, 31 Aug 2021 21:36:23 +0000 Received: by mail-qv1-f51.google.com with SMTP id e18so313962qvo.1 for ; Tue, 31 Aug 2021 14:36:21 -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=Ctg0uU0ZKLrK8MGeOhA4wUoiuKcZhmadHnZfrQyBB08=; b=vdZ4q1MZejzQ14L2dSam19euepcBWpxuSngtdX6vX2e4LRs7nb4ciRyPgBUD194JTf iFTm4zgke8h/BKA0nBog3kKJ3DnndHPHmWEyX7BEpgQU31Vvmw8rFUalqH8x5FX90w3d ITrHZqf24kukEzS297WadZ2jsKzPwGt5TRC+LboKBW/8rVAIGm2HwfdKVmQjuRFizXhH Mc6ujbiMUSgp4kSuKzxBSVJYGs2LH5LI11G0c1/t/e7giq5nSQOjuBRYDxwwDEPgUqbc 5ti5rS0HO721s/fmwab8teBQ1VSkthLdhhbUHJCbc8XiMi+my9zIT/w1GyuJSZ8oAocQ IgHQ== 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=Ctg0uU0ZKLrK8MGeOhA4wUoiuKcZhmadHnZfrQyBB08=; b=CASI4Ri3sWx8aFhudbNfLkxIhSfnzanfjm11iEiw49khsD2WkMF/xTn5FGnY8W/qe2 6kNSkcGo9bvUbd6JB9JqS1YNH6NsRqXii1uWZJAOvtxng+dqp9ScF563KUzrukHbQLU6 uJua/1pA1mprSNI4UVO0iM9dy4eWkAOl7UUmREYKYdQfEC1IXLS9bEYehZbaCfcB12zt X1bXMR0GBHNAK/3IVvRFeKRTkeTiCiYZ6XATAY48Du1XCoRzUKbmEh1i5i18dZ2h48Ij Bb2qwQIr19RY+n7KlH2Rwsqp1u5oy/p9sjCFNC4BqF2WXv7p+Mx6Zzd+3xgNOvy+YeqQ 6WPw== X-Gm-Message-State: AOAM531pd1QJFFYnDmPeXYxt8i8VqKjkuwWFgZLxgW4rbB+Kf5v0RGw2 s8qyloaGcLZdfETYH6le4YS5cCf4Tu9fdIgxHHYN4NYDOz0= X-Google-Smtp-Source: ABdhPJzxTEFN1uY63MkDQSjFliNk9cUY5lChU6UQaaYZpj+c0sLyQJzqLxYuh2jnOQJ50ER4/3jfITjsx3eh3uabCEU= X-Received: by 2002:ad4:4f32:: with SMTP id fc18mr31027849qvb.3.1630445780689; Tue, 31 Aug 2021 14:36:20 -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:36:09 +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: 27034 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: > > So to sum up, it sounds like your advice is "Always use a script instead > of a function. If the script can't work for whatever reason, then use a > function." Close enough. > To keep things organized, I think I set up a subdirectory called > ~/bin/shell_alias_scripts, add it to $PATH and toss all the scripts that > are used by aliases in there. 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. If you only intend to invoke these scripts via aliases and never directly from interactive shells or from other scripts, then you don't need to put them in PATH. You can invoke them via their full names instead. alias foo='~/.local/libexec/bar -blah' ~/.local/libexec would be your local equivalent of /usr/libexec, which contains a bunch of executable files that aren't meant to be in PATH. If you do intend to invoke these scripts either from interactive shells or from other scripts, your plan is fine, although I would just put all these scripts in ~/bin. Roman.