I have a file that has a list of numbers in it. Each line has a different number. I am trying to create some sort of loop within a script that will pick the numbers up on lines 1 and 2 and then put those figures into the script. It then goes through the process then loops back and reads lines 2 and 3. This is to keep looping till it reaches the end of the file. The problem i am having is that i do not know what command to use to pick up the relevant lines.
I do not think this will work as it will on pick out the first couple of lines. I need something that will pick up lines 1&2 use them in the script, then loop back and use lines 2&3, then loop back and use line 3&4 etc........
$ awk 'NR>1{print prev " " $1}{prev=$1}' file1 |\
> while read VAR1 VAR2
> do
> echo script commands can use $VAR1 $VAR2
> done
script commands can use nane jees
script commands can use jees tree
script commands can use tree kiare
script commands can use kiare queig