Re: using echo 'text' > file (to add to last line of several…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Dale Farnsworth
Date:  
To: plug-discuss
CC: 
Subject: Re: using echo 'text' > file (to add to last line of several documents)
> On 10/27/2010 01:02 PM, Matt Graham wrote:
> > From: Eric Shubert<>
> >> On 10/27/2010 12:30 PM, Matt Graham wrote:
> >>> alias ..='cd ..'
> >>> alias ...='cd ../..'
> >>>
> >>> ....and I don't believe you can write a script named ".." without
> >>> a lot of fooling around....
> >> What happens though when you try to use the real command? Does it
> >> result in: $ cd cd ..
> >
> > "man bash" , the ALIASES section:
> >
> > The first word of the replacement text is tested for aliases, but a word that
> > is identical to an alias being expanded is not expanded a second time. This
> > means that one may alias ls to ls -F, for instance, and bash does not try to
> > recursively expand the replacement text.
> >
> > No idea what non-bash things do.
> >
>
> That doesn't appear to me to say you won't get
> $ cd cd ..
> if you type
> $ cd ..
> when your alias is defined.


The alias is for "..", not for "cd".

Only the first token (the command) on a line is checked for aliases, not the
remaining tokens (arguments to the command).

-Dale
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss