[gnu.bash.bug] Bash 1.03 alias expansion problem

andrewt@watsnew.waterloo.edu (Andrew Thomas) (09/06/89)

System: uVax II running Ultrix 2.0.  Compiled with gcc -traditional
Version: bash 1.03.26

Bash 1.03 (and all versions prior) expands the word after a >&
redirection if that word is an alias.  For example, if I alias
  alias 1=%1
then the command
  cat /etc/passwd > /tmp/tmp 2>&1
expands to
  cat /etc/passwd > /tmp/tmp 2>&%1
which is an error.

The command 
  cat /etc/passwd > /tmp/tmp 2&>1
redirects the output from the cat to the file '1', while creating the
file /tmp/tmp.  Is this a bug, or is is my own confusion on the syntax?

In any case, it seems like a BAD THING to alias expand anything after
a redirection.  Is there a rationale for this behaviour?

--

Andrew Thomas
andrewt@watsnew.waterloo.edu	Systems Design Eng.	University of Waterloo
"If a million people do a stupid thing, it's still a stupid thing." - Opus