I am new to bash. When I run the following command:
grep "type" /root/myFile | cut-d'=' -f2
I get the following:
102 304 503 442
I want to store the contents of the first command into a variable such that the content of the variable would be the equivalent of declaring it like this:
myVariable="102 304 503 442"
I don't know how to go about this. Do I initialize
myVariablewith an empty string and traverse the content of the command line-by-line and append it into myVariable with white spaces in between or is there an easier way for doing this with bash?