Thank you for your patience I am new to linux and I wanted some help understanding how I can parse the output of the cut command.
So, currently I have a variable
x=$(discover nginx --human=nood | cut -f1,6)
So my output to echo "$x
is a list of like
instanceID IPAddress
In my program I want to run a for loop over each row of x and extract the first and the second variables separately. Eg: if it was an array a[0] = instanceID and a[1]= IPAdderess
Please can someone guide me how to extract the elements separately.
I know that I can run a loop in $x
and do a cut within that but I am looking to understand if there is a better way of doing it.
When I try
– Shivangi Singh Nov 25 '19 at 17:45"$x" |cut -f1,6 | while ...
I get an error of command not found