How do you store a command in a variable in UNIX?

Lê Minh

Member
How do you store a command in a variable in UNIX?
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 …] arg1 arg2 …’
 

Tìm kiếm

Back
Top