This question already has an answer here:
How can I put the output of head -15 textfile.txt
to a variable $X
to use it in an if
command like this:
if $X = 'disabled' then
?
This question already has an answer here: How can I put the output of
? |
|||
marked as duplicate by jasonwryan, Graeme, slm♦, goldilocks, Hauke Laging Mar 28 '14 at 22:31This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||
|
Generally, any time that you want to capture the output from a command into a shell variable, use the form: Also note that the shell does not do Many consider it best practices to use lower-case variables for shell scripts. This is because system defined variables are upper case and you don't want to accidentally overwrite one. On the other hand, there is no system variable called |
||||
|