Say I have 2 variables that I am assigning as follows:
psaux=`ps aux | grep someProcessName`
pscount=`ps aux | grep someProcessName | wc -l`
I would like to combine the assignments in one line, so that the "ps aux | grep someProcessName" part is only executed once, so I know there's no possibility something could change in between two executions.
The closest I can come is the following grotesque pseudocode:
read psaux pscount <<<$(ps aux | grep someProcessName | tee &1 | wc -l)