Iain,

thanks for reporting this. The behavior is however as expected. Quoting from 
the bash manpage:
----
ALIASES
       Aliases  allow  a  string  to be substituted for a word when it is used 
as the first word of a simple command.  The shell maintains a list of aliases 
that may be set and
       unset with the alias and unalias builtin commands (see SHELL BUILTIN 
COMMANDS below).  The first word of each simple command, if unquoted, is 
checked to see if it has an
       alias.   If so, that word is replaced by the text of the alias.  The 
characters /, $, ‘, and = and any of the shell metacharacters or quoting 
characters listed above may
       not appear in an alias name.  The replacement text may contain any valid 
shell input, including shell metacharacters.  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.
----

AFAIK it has always been the case that aliases are only applied for the
first word of a command.

As a workaround, couldn't you just use alias visudo='sudo -E visudo' and
the just call visudo (without sudo)?

Anyway, this is not a bug in bash.

Regards,
 Mika

** Changed in: bash (Ubuntu)
       Status: New => Invalid

-- 
aliases not accounted for after first command
https://bugs.launchpad.net/bugs/231258
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to