Was wondering if someone can help me with this. So I have a text file with 10 lines, a while loop and a counter that starts at 10. For each iteration of the loop, I will decrement it. However for every iteration, I want to extract a line say the 10th line on the first rotation and the 9th line on the second to compare them. Is there a function that say you pass a value to and it extracts a certain line? or some combination of it. Would appreciate the help
Thanks
Was wondering if someone can help me with this. So I have a text
Share
Pass your line number to
awk:If you have the line number in variable
ithen:val=$(awk -v line=$i 'NR==line{print;exit}' filename)will store the
ith line into variableval.