Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process substitution cannot be part of a larger argument #215

Open
McDutchie opened this issue Mar 11, 2021 · 1 comment
Open

process substitution cannot be part of a larger argument #215

McDutchie opened this issue Mar 11, 2021 · 1 comment
Labels
1.1 Issue relevant to dev branch (v1.1.*) bug Something is not working

Comments

@McDutchie
Copy link

Unlike a command substitution, a process substitution always becomes a separate argument, even if not surrounded by whitespace. This problem is present in all ksh versions.

This breaks GNU-style long options, as reported by @ScottRochford in att#1487:

$ echo foo<(:)bar
foo /dev/fd/4 bar
$ echo $KSH_VERSION
Version AJM 93u+ 2012-08-01

This breaks things like tar ... --files-from=<( command ) because the space separates the long option from its parameter.

@ormaaj
Copy link

ormaaj commented Jul 4, 2023

Sometimes with regular command words it at least parses but splits the words. I think that's this bug.

(ins)ormaaj 3 (23237) 0 ~ $ x=foo ksh -xc ': "${x}"<(:)'
+ : foo /dev/fd/3
+ :

Then there's another problem with redirects.

(cmd)ormaaj 3 (23237) 3 ~ $ ksh -c '<$(:)<(:)'
ksh: syntax error at line 1: `<(' unexpected

That can be useful when one of the subshells is used for side-effects.

@McDutchie McDutchie added the 1.1 Issue relevant to dev branch (v1.1.*) label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.1 Issue relevant to dev branch (v1.1.*) bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants