🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #545

Bash 1.03 alias expansion problem

#545
From: Andrew Thomas
Date: Tue, 05 Sep 1989 22:46
25 lines
1146 bytes
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
Technical Details
Message-ID: <11400@watcgl.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watcgl!watsnew!andrewt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watcgl!watsnew!andrewt
From: andrewt@watsnew.waterloo.edu (Andrew Thomas)
Newsgroups: gnu.bash.bug
Subject: Bash 1.03 alias expansion problem
Message-ID: <11400@watcgl.waterloo.edu>
Date: 5 Sep 89 22:46:19 GMT
Sender: daemon@watcgl.waterloo.edu
Lines: 25