From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 558 invoked by alias); 17 Dec 2013 18:41:50 -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: 18244 Received: (qmail 15998 invoked from network); 17 Dec 2013 18:41:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: zzapper Subject: Re: Can an alias ever have a dynamic element? Date: Tue, 17 Dec 2013 18:41:17 +0000 (UTC) Organization: rayninfo Message-ID: References: <131217091556.ZM8432@torch.brasslantern.com> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 87-194-164-3.bethere.co.uk User-Agent: Xnews/2009.05.01 Bart Schaefer > } > } I have an alias which creates a tar with a date component in its name > } that date is however evaluated when the shell is created which could > } have been a few days ago. The easy solution is to create a script but > } is they any alternative? > > This usually means you've created the alias with something like: > > alias thingy="foo $(date)" > > when what you need are single rather than double quotes: > > alias thingy='foo $(date)' > > LOL I foolishly never realised that single and double quotes behaved differently for aliases!! alias maketar='dw && zargs ./**/*.{php,inc,js} -- tar rvf /tmp/serviceplan $(date "+%d-%m-%Y").tar Thanks Bart https://twitter.com/dailyzshtip