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

Re: Bash argument expanded inside alias



On Tue, Mar 13, 2012 at 11:49 AM, Clive Standbridge
<list-user@tgstandbridges.plus.com> wrote:
>>
>> Anyone knows why this command:
>>
>> :~$ alias muda='find . -name "*" -mtime -$1'
>>
>> and all this variations I tried:
> [...]
>> does not work to do what your intuition imagine what I want it to do?
>
> Hi Beco,
>
> It doesn't work because aliases don't take arguments.
> You can use a shell function instead. For example,
>
> muda()
> {
>   find . -name "*" -mtime -$1
> }

My added alias was silly... :)


Reply to: