I am trying to understand the differences between these two similar commands.
aa=$(foo | bar | head -1)
read aa < <(foo | bar | head -1)
- I know that
<()
requires #!/bin/bash
, but does that make it slower?
- Do they create the same amount of subshells?
- Do they require the same amount of
bash
or sh
processes?
I am looking to use the command with the best performance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…