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
orsh
processes?
I am looking to use the command with the best performance.