bug-bash
[Top][All Lists]
Advanced

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

Re: A bug in bash


From: Chet Ramey
Subject: Re: A bug in bash
Date: Thu, 04 Dec 2003 08:11:32 -0500

> beetle{mal}5: bash
> bash-2.05$ if [ ! -f /usr/bin/mailx ] ; then alias mailx=mail; fi; type mailx
> mailx is aliased to `mail'
> bash-2.05$  exit
> exit
> beetle{mal}6: bash
> bash-2.05$ type mailx
> bash: type: mailx: not found
> bash-2.05$ if [ ! -f /usr/bin/mailx ] ; then alias mailx=mail; fi; echo kjljl 
> | mailx
> bash: mailx: command not found # . . . . . . . . . ! ! ! ! ! ! ! ! ! ! ! ! ! 
> ! ! !

Does nobody ever read the manual page?  From the ALIASES section:

       The rules concerning the definition and use  of  aliases  are  somewhat
       confusing.   Bash  always  reads  at  least  one complete line of input
       before executing any  of  the  commands  on  that  line.   Aliases  are
       expanded  when  a command is read, not when it is executed.  Therefore,
       an alias definition appearing on the same line as another command  does
       not  take  effect  until  the next line of input is read.  The commands
       following the alias definition on that line are not affected by the new
       alias.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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