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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6310 invoked from network); 17 Feb 2023 19:11:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Feb 2023 19:11:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676661088; b=dOHVRld2H8yTjxwiOm8EK1kM+bpzPsHsLVnGuWOE82h4bor9lgKYa517I3JddGBactBMbIBxSQ fsiLML+f2RteGGDPxFtRkx/6hsIYSVzymWnizOtdyvaHpjt8+m74lUqvXf6Jah5kATrdMQLxwY mguw8Hhw+LcuEmFvl2F+p9ScPPX+AmsM041D4B1SVGXd56PM5GDZpBJWpUMBoAOfoxDDd8QWwy Ai0/1yybNvgG97dRse50s8hH0+5cfhjyps/WHYIUfF5vhMhH2zw/xg0mSnenjlO6W4UgSiiTTT sfIlHQ0Vx+zy+Iku+QID3eI9ueyq0mTvqz5mCbCu7UDIyw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f46.google.com) smtp.remote-ip=209.85.208.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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=1676661088; bh=gnZ5NexfJdUZjqA+FzphGG4BwS9See6OXxT7LZSJbh0=; 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=h5F8Vjhpg0CqR55LeqI1d6GuPhe6EVGN7alrVkfE9t5Vobx/VYPucy1SzQt3wO7kg1rn1oLb76 zQSB+XuiEzDTmMd3KNpo7uoz4j/7WcROIzLgOn+8rQp6yM0hurxSf5Tf5wybLRQiRbRo8YQNF0 Ny8djsoDgsKMkaKNSClj7YvQyBnhSj33NA5ZN6yRrzdFATIhG/YzYHkD+KNAr4MwuAo5a9FM9D ZAcTGwFaM1cv/zu+ukUryFTyef3BEVnlKxH4UchpXkvkLXASdI6rxNPByM5lUjTUBqYxVr/wPD tG+CmvPWOUA6BNzkWugzGi3BEi2iM9zDI+SAYPIQcfpeKw==; 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=F4RsxV9tBGp75vVIa/HuoW9Hs388GOvhIX2abw09Z8c=; b=YsBGaF4B0c9xG4xOMJNpr5RM0G rsAP3y7Dj/w6EzPY+/DoS9XaPP2KJwGph333/luI/op4JaP3t5QE/fE9QZmsmV1fvLM3p+xQbSiwF w7R5hy1gFZ0RkQF3MFC7zPdAzcpq3AlCgkkY+w/qZ5trPLSIFDeazfZRNYP6+ynxPngj35I9UbsWU Me3M/OeEujymCyUjS4KkzE9vw50/Iv4lOK2MTOUstOqvnYrv5TsPVu9bmNgKN3Y5tHNbOBb4nHa8a iKDUDiNsMQvAnYW0T7vEyKghaHVYez8wAs4F++sX+4SURRt6SnRHM3cjcAdp0Ebj+hfhTyXvEV8g5 xPJoI1DQ==; Received: by zero.zsh.org with local id 1pT68k-00041T-JO; Fri, 17 Feb 2023 19:11:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f46.google.com) smtp.remote-ip=209.85.208.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f46.google.com ([209.85.208.46]:42795) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pT68B-0003gf-Re; Fri, 17 Feb 2023 19:10:52 +0000 Received: by mail-ed1-f46.google.com with SMTP id m17so8503382edc.9 for ; Fri, 17 Feb 2023 11:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=F4RsxV9tBGp75vVIa/HuoW9Hs388GOvhIX2abw09Z8c=; b=zlyajxVe/B81N6ke1WuSl6VTbLrb5vnHVqDgCtsw+tzmznvfNZP1GjvaPgne/x/Ht9 rc0WIdnuK0fYHpBFCuBLpFd+xGHpoHagxjGJJPhj/zJh8G2O14jBPPClVQy22rjRaN3z sLDqqwv+DreFG3Ty8jQxOC+MH5qSvZShvLpxw39zszKQdXGcDwvdmL4ul+nJrKJi6TRy Z1etv1I3o46a3w6ZIxqZXEp7Hczjq+Hcsn90M1YiNBM6/iGYw7H8fQnREtdu5Xe92Q7U EOwuJfwycCo6JzsVtGBROmDsy7YSirCisiFAS//Gf0ilp2Z3jCyjywklfiNeg6YGYZx5 IW8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F4RsxV9tBGp75vVIa/HuoW9Hs388GOvhIX2abw09Z8c=; b=uK07gyggEFZvTqbQwuVHipL/MGixrbF0i8+MghRrCc03ul97kKWPA2YPwWOhVZbfvr zcO7hwveO3qKXDDQwx9bcewrOnHZbK5e+jA3ZmdpSVHhuNUOPnP1QnFMXba53cf5qffu bZkErkgquEsU24Xa6q1lY6u71+OjQanpfqhEHxo4NLkTi0rzt/pfR2nHVrOL23BU6IvM H/MG7W0dLOclZ5nSw7G6x016wbCvUURLZBapu3s4/Y4B06RAmwLcVEnokS4AIecxy9LB 3AKc9dynGeOgLSXxoTAA0QyM1cqczdZqOkVn194c3l1rpbM/AvHFB354ICmnvmTga1SJ stOQ== X-Gm-Message-State: AO0yUKVLeYh8JBB3jgCYsDcyJ/JsfT5xBU15bejaK4IGQNUNzaYsPeda gBtIctnG2SqYByjokPa1WYPWozjiLjXhnADRG1ZKeSMFwUlYbw== X-Google-Smtp-Source: AK7set9KzTgsDiR9QR/ylX0H4snZ6mZ8QIU1UJOQi2WTyU47yHtl4ni5vNTvpwGJe3PXZZh1C3m1AVzlfQ0bivvlwrg= X-Received: by 2002:a50:c35d:0:b0:4ad:7943:f4b9 with SMTP id q29-20020a50c35d000000b004ad7943f4b9mr2431367edb.2.1676661051195; Fri, 17 Feb 2023 11:10:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 17 Feb 2023 11:10:39 -0800 Message-ID: Subject: Re: what can be global aliases used for? To: Sebastian Gniazdowski Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51451 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, Feb 17, 2023 at 6:59 AM Sebastian Gniazdowski wrote: > > I wonder what else can global aliases do? As Roman has already indicated, it's not a recommended practice to rely on aliases of any kind in scripts. Aliasing is intended as an interactive feature to reduce time spent typing commonly-used idioms. That said, the most common use I've seen made of global aliases is this kind of thing: alias -g L='|less' % ls -lLR L That is, append L instead of "|less" to commands that are expected to produce many pages of output. Similarly stuff like alias -g TODAYS_FILES='-lrt | fgrep "$(date +"%b %2d")" | awk '\''{print $NF}'\' % ls TODAYS_FILES (yes, there's a more zsh-ish way to do that, and it could also be a command alias by sticking the "ls" in front, just using the pipeline as an example).