Re: Process substitution as part of a word [was: Incorrect alias expansion ...]

2022-02-03 Thread Chet Ramey

On 2/3/22 9:09 AM, Martijn Dekker wrote:

Op 02-02-22 om 20:59 schreef Chet Ramey:

[...] it makes no sense to join a process substitution to another word.


But it does. In arguments that look like assignments, and in GNU-style long 
options, file names can be part of a larger word.


You're right. I assume Korn simply didn't consider that use case.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Process substitution as part of a word [was: Incorrect alias expansion ...]

2022-02-03 Thread Martijn Dekker

Op 02-02-22 om 20:59 schreef Chet Ramey:

[...] it makes no sense to join a process substitution to another word.


But it does. In arguments that look like assignments, and in GNU-style 
long options, file names can be part of a larger word.


Assuming tar is GNU tar, something like

tar -c -f txt.tar --files-from=<( ls *.txt )

works fine on bash and zsh, but not on ksh93; the process substitution 
becomes a separate word and the command fails.


This was reported as a bug to the abandoned AT ksh2020 development 
effort but never fixed there, and I've no clue how to fix it yet either.

https://github.com/att/ast/issues/1487
https://github.com/ksh93/ksh/issues/215

--
||  modernish -- harness the shell
||  https://github.com/modernish/modernish
||
||  KornShell lives!
||  https://github.com/ksh93/ksh