Simple question:
Fetch numbers(i) from a list of number; then use each of the number to do sth.
for i in list_of_number;do cat file|head -$(($i+1))|tail -1;done
This seems right but actually doesn't work. What's the problem here? thx
Doing this will treat list_of_number as a string; I assume this is a file which contains a list of numbers that you want to loop over.
Try instead:
for i in `cat list_of_number`;do cat file|head -$(($i+1))|tail -1;done