Store Printed Output In Variable Bash

[Solved] Store Printed Output In Variable Bash | Php - Code Explorer | yomemimo.com
Question : save output of command to craible bash

Answered by : thelazylemur

password=$(openssl rand -base64 32)
echo $password

Source : | Last Update : Fri, 13 Nov 20

Question : store printed output in variable bash

Answered by : armando-flores

#For storing and printing output at the same time do following:
OUTPUT=$(ls -1) #First assign output of command execution to a variable
echo "${OUTPUT}" #Then print out the result in variable into the terminal

Source : | Last Update : Thu, 24 Dec 20

Answers related to store printed output in variable bash

Code Explorer Popular Question For Php