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=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22990 invoked from network); 22 Jun 2020 23:24:43 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 22 Jun 2020 23:24:43 -0000 Received: (qmail 23704 invoked by alias); 22 Jun 2020 23:24:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24941 Received: (qmail 10666 invoked by uid 1010); 22 Jun 2020 23:24:31 -0000 X-Qmail-Scanner-Diagnostics: from mail-il1-f195.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25850. spamassassin: 3.4.4. Clear:RC:0(209.85.166.195):SA:0(-2.0/5.0):. Processed in 1.803955 secs); 22 Jun 2020 23:24:31 -0000 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.195 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OjRr5Jr/DOD/aMXRFQRhxdacf2iLQUu9+TyEkJ7Pf6o=; b=MrMOQrGrO6shE4WwDxFaKD0By8SXLZr4V/rgrKtRcMepjOKJujAIsh7VMLWwwgXUNv KBnomWVn9qAqNZ+biPGX0wPq7mC9auCFvJc0ll2m+BpPQOLzvkMzzbOHbgRu2F5KL3KH YkFKOpELBOIQOJd4zK74cs9FR5pRRJ+09GYA5bIQlgD+156nf1Zt8lGsNrqdJnJXLh2e hwDVQG2cGzZAO6IAvFwrwy7YYM7Mk0ZmY/jTjyqoauA4us8DcoZkZ5lsKQQ3Hmrv8T5y bRSpi5yU13mFkirkmR+18+KeXMEjctPMMV+wfE/m/DVLHuB9CYjgLlTWBeEUSmkT8HEa jkWg== X-Gm-Message-State: AOAM532VTGiikwd5EbQljY8np1ngCMaKO5lVHhW6jEmCQX7rPtlR9U6m wsZuei/Jf1by2PcA842e68KkPsClY7q+Ignafgk= X-Google-Smtp-Source: ABdhPJzoOAYe262xPuEKfZ3/12L9YojcY+FSgodTkZy4TzRJfmN6ftwxAAz1lHNqPSKRXdKpN5eep94LW6UI+ZIbEgY= X-Received: by 2002:a92:5f9c:: with SMTP id i28mr20705970ill.25.1592868236409; Mon, 22 Jun 2020 16:23:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Mikael Magnusson Date: Tue, 23 Jun 2020 01:23:55 +0200 Message-ID: Subject: Re: Alias call in function fails... To: Frank Gallacher Cc: "zsh-users@zsh.org" Content-Type: text/plain; charset="UTF-8" On 6/22/20, Frank Gallacher wrote: > Greetings, > > I have a function: > [...] > > Which calls an alias: > > alias dumpit='hexdump -C -n 128' > > It works fine in bash, but with zsh now I get: > > :::::::: test.txt :::::::: > dumpall:11: command not found: dumpit > > Am I doing something wrong??? Yes, don't use aliases for anything but interactive usage. Eg if you want to use dumpit in a script, make it be a function: dumpit() { hexdump -C -n 128 } Aliases are expanded on parse time, which means aliases defined in a file won't be usable in that same file. (Because it is parsed in its entirety before any of the code is actually run). -- Mikael Magnusson