[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: echo test >& "quote'test"
From: |
Chet Ramey |
Subject: |
Re: echo test >& "quote'test" |
Date: |
Wed, 10 Apr 2024 09:27:37 -0400 |
User-agent: |
Mozilla Thunderbird |
On 4/8/24 9:37 PM, squeaky wrote:
Bash Version: 5.2 Patch Level: 21 Release Status: release
Description:
Running
echo test >& "quote'test"
should create the file "quote'test", but it creates "quotetest"
instead.
Repeat-By: echo test >& "quote'test"
Thanks for the report. This is specific to this form of redirection. The
issue is that the WORD following the >& is expanded multiple times, since
it has to be expanded once to determine whether it's a number, filename,
`-', or empty. Once it's expanded, and known to be a filename, it shouldn't
be expanded again.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/