From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25461 invoked by alias); 4 May 2016 13:54:47 -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: X-Seq: 21511 Received: (qmail 29327 invoked from network); 4 May 2016 13:54:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Virus-Scanned: amavisd-new at phear.org Date: Wed, 4 May 2016 13:46:32 +0000 From: Marc Chantreux To: zsh-users@zsh.org Subject: make aliases work inside the function? (using a preprocessor?) Message-ID: <20160504134632.GA5729@aurora-borealis.phear.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) hello zsh people, I have % which € € () { setopt localoptions unset nowarncreateglobal "$@" } % which l l: aliased to print -l % € l error €: command not found: l sometimes i really need aliases. sometimes aliases seems to work inside functions. sometimes i made some hacks like eval "xx () { $functions[xx] }" sometimes it works, sometimes it doesn't. i spend some time in the manual to make up my mind about how to fix it. i guess i'll use a preprocessor (m4?) and maybe even an existing lib (m4sh?) to generate my zsh scripts. any ideas about it? regards. marc