[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unalias from within a subshell does not work?
From: |
Chet Ramey |
Subject: |
Re: unalias from within a subshell does not work? |
Date: |
Mon, 17 Dec 2001 09:03:37 -0500 |
> Machine Type: i686-pc-linux-gnu
>
> Bash Version: 2.05a
> Patch Level: 0
> Release Status: release
>
> Description:
> I set 'alias make="make -j2"' Then within a subshell ()
> I 'unalias make', yet when make is called from within that subshell
> it is still aliased. While I do not expect the unalias to exetend
> outside the subshell, I did expect it to work within the subshell.
> Is this a bug?
No. You need to read the manual page, where it explains that aliases
are expanded when a compound command is read, not when it is executed.
By the time the `unalias' command is executed, alias expansion has
already taken place.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)
Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/