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

Re: Question about expansion: redirection(<) vs command(cat)




Bart,

On Tue, Jan 13, 2026 at 3:19 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

The issue here is that the token "$(<" is a special case of "$(" and
not a special case of "<" redirection.  Docs under "Command
Substitution":

  The substitution '$(cat FOO)' may be replaced by the faster '$(<FOO)'.
  In this case FOO undergoes single word shell expansions (_parameter
  expansion_, _command substitution_ and _arithmetic expansion_), but not
  filename generation.  No subshell is created.

Note "but not filename generation".

Appreciate the information.  Not what I expected, but it is what it is. Was able to
use an alternate method in order to use redirection. I should probably reread all
of the man pages and hopefully absorb what I missed before.

Thank you.

Regards,

JIm


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