The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: alternate lines
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-17-2008
sanjaypraj sanjaypraj is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 7
You can try this shell script

rm -f fileout
i=1
while read line
do
if [[ $i -eq 1 ]]
then
echo $line >>fileout
i=0
continue
fi
if [[ $i -eq 0 ]]
then
i=$((i+1))
continue
fi
done<$filename