How do you save a command output of a variable in a shell script?

Trương Duy

New member
How do you save a command output of a variable in a shell script?
Answer
To store the output of a command in a variable, you can use the shell command substitution feature in the forms below: variable_name=$(command) variable_name=$(command [option …] arg1 arg2 …) OR variable_name=’command’ variable_name=’command [option …]
 

Tìm kiếm

Back
Top