How to assign the output directly printed in a pipeline to a variable?


If there are some ways to get the directly printed outputs?
I want to assign them to variables.