Re: Redirection between assignment statement and command name prevents a
From:
Robert Elz
Subject:
Re: Redirection between assignment statement and command name prevents alias substitution
Date:
Tue, 23 Mar 2021 18:26:08 +0700
Date: Tue, 23 Mar 2021 13:10:19 +0300
From: =?UTF-8?B?T8SfdXo=?= <oguzismailuysal@gmail.com>
Message-ID:
<CAH7i3LoGDWw0hkVWc9sviZB0RVRK-sy2emC8T6iZodpgskRE1g@mail.gmail.com>
| $ echo a > a
| $ echo b > b
| $ alias l='< ' a=b
| $ l a cat
| a
|
| I can't think of any reason not to expand `a' there.
I can think of a reason (though the NetBSD sh does expand it) -- after
a '<' you're certainly not in the command word position, what comes next
must be a redirect operand (filename). The space at the end of the 'l'
alias value should cause alias expansion, but I can almost understand why
it might not.
kre