bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: magic needed: alias concatenation of $1


From: Paul Jarc
Subject: Re: magic needed: alias concatenation of $1
Date: Fri, 03 May 2002 19:14:52 -0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i686-pc-linux-gnu)

address@hidden (ivo welch) wrote:
> alias tryme="$PWD/$1"

This won't do what you think.  $PWD and $1 are substituted when the
alias is defined, not when it is used.  You can define the alias like
this to get what you want:
alias tryme='"$PWD/$1"'
This happens to work, but I'm not sure whether it's by design or by
accident.  The right way is to use a function instead of an alias:
tryme() { "$PWD/$1"; }


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]