1

Reading a line and the next line in a shell script

view story
linux-howto

http://www.unix.com – Hi, I'm trying to read a line and the next line in a shell script by executing the following code: Code: for i in `seq 1 $numLines`; do         line=$(sed -n '{$i}p' outputFile)         echo $line done $numLines contanis the outputFile's number of lines. It doesn't work and I cannot use a while loop because I need to reed $(i+1) line after $i line. Another question, how can I increase the counter in two integers instead of one? By using a while loop like the following I think I cannot read the line and the next one because it runs line-by-line (HowTos)