Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: parse error in process substitution



On Nov 17, 10:10am, Peter Stephenson wrote:
} Subject: Re: parse error in process substitution
}
} > schaefer[509] echo $(<(echo cat))                    
} > zsh: permission denied: /proc/self/fd/10
} > 
} > I wonder if the $(< ....) form should also be special-cased?
} 
} Possibly, although you could also argue that if the contents look like
} anything other than < followed by something that expands to a string
} it should do that.

The question is whether "$(<" binds more tightly than "<(".  I suppose
the answer is that really it's dollar oparen redirect word cparen that
has special meaning, and in lessthan oparen list cparen, lessthan is
not a redirect even though it "looks like" one (because "<(" is a
token unto itself, not the two tokens lessthan and oparen).

} It depends what you mean by "look like". You need to quote
} metacharacters to be sure of getting a file name in general, of
} course.

schaefer[502] bash                 
[schaefer@torch]$ echo < (echo cat)
bash: syntax error near unexpected token `('
[schaefer@torch]$ exit
schaefer[503] echo < (echo cat)
zsh: number expected
schaefer[504] echo $(< (echo cat) )
zsh: no such file or directory: (echo cat)
schaefer[505] echo $(<(echo cat) ) 
zsh: permission denied: /proc/self/fd/10

I'm not really making anything of the above yet, just pointing it out.



Messages sorted by: Reverse Date, Date, Thread, Author