Assigning the output of a command to a variable [duplicate] March 28, 2023 by Tarik You can use a $ sign like: OUTPUT=$(expression)