🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Andrew Thomas Tue, 05 Sep 1989 22:46
Bash 1.03 alias expansion problem
#545
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads