Vino,
The line:
Should be replaced by:
Hemangjani,
If the input file has an odd number of records, your output does not produce
a line break for the last record.
Here is another way:
Code:
typeset -i mLineCnt=0
mOutLine=''
while read mLine
do
mLineCnt=${mLineCnt}+1
mOutLine=${mOutLine}${mLine}
if [ ${mLineCnt} -eq 2 ]; then
echo ${mOutLine}
mOutLine=''
mLineCnt=0
fi
done < input_file
if [ ${mLineCnt} -ne 0 ]; then
echo ${mOutLine}
fi