bug-bash
[Top][All Lists]
Advanced

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

Re: strange 'delayed' aliases


From: Chet Ramey
Subject: Re: strange 'delayed' aliases
Date: Wed, 23 Dec 2009 07:34:42 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

On 12/22/09 5:18 PM, Jonathan Claggett wrote:
> Hi all,
> 
> I'm not sure if this is a bug or not but it certainly caught me by surprise.
> I accidentally created an alias ending with a backslash and a newline today
> and the resulting alias proceeded to grab the text on the line _after_ I ran
> it. For example:
> 
> *$* echo $BASH_VERSION
> 4.0.33(1)-release
> *$* alias x='echo \
> *>* '
> *$* x
> *$* Hello, World!
> Hello, World!
> **
> Is this delayed response expected?

I would think so, since you've inserted a command continuation (the escaped
newline) into the command via the alias.  It's the same as if you had typed

*$* echo \
*>* Hello, World!

The only unexpected part is the re-issuing of $PS1 as opposed to $PS2.
I'll have to take a look at that.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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