[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Why `$(<` is slow?
From: |
Stephane Chazelas |
Subject: |
Re: [Help-bash] Why `$(<` is slow? |
Date: |
Fri, 30 Aug 2019 18:56:02 +0100 |
User-agent: |
NeoMutt/20171215 |
2019-08-30 09:51:08 -0400, Chet Ramey:
[...]
> Bash parses the command and makes sure it's a valid redirection instead
> of doing it lexically. That happens in the subshell just like any other
> command substitution.
[...]
By the way Chet, at that
https://unix.stackexchange.com/questions/189749/understanding-bashs-read-a-file-command-substitution/368663#368663
I mention something that might be seen as a bug in bash:
bash-5.0$ echo test > file
bash-5.0$ echo "$(<file # comment
)"
test
bash-5.0$ echo $(# comment
< file)
test
bash-5.0$ echo $(< file
)
test
OK, but:
bash-5.0$ echo "$(<file
# comment
)"
bash-5.0$ echo $(< file
)
The $(<file) seems not to be recognised as the $(<file) operator
in the last two cases which seems a bit inconsistent.
--
Stephane