On 5/30/14, 11:01 AM, Bruce Korb wrote:
>     $ . xx ; cat xx ; proj ; pwd ; pwd -P
>     alias proj="cd ~/'google drive'/web"
>     bash: proj: command not found
>     /home/sciadmin/tmp
>     /home/sciadmin/tmp
>     $ . xx
>     $ cat xx ; proj ; pwd ; pwd -P
>     alias proj="cd ~/'google drive'/web"
>     /home/sciadmin/google drive/web
>     /home/sciadmin/foo bar/web
> 
> Clearly, there is a behavioral difference.  Is this a bug or feature?

Eric's summary is comprehensive.  Here's a shorter version.

1.  The shell always reads at least one complete line before parsing and
    executing it.

2.  The shell parses the line into commands before executing any of them.

3.  Aliases are expanded when the line is read, not when it is executed.


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

Reply via email to