Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:18

0001 #! /bin/bash
0002 
0003 typeset -i mLineCnt=0
0004 
0005 nlines=2
0006 
0007 IN_FILE="./mickey.file"
0008 OUT_FILE="./output.dat"
0009 
0010 if [ $# -lt 1 ];then
0011 echo "Please provide at least one argument, the input file"
0012 exit
0013 else
0014     IN_FILE=$1
0015     if [ $# -eq 2 ]; then
0016         OUT_FILE=$2
0017     fi
0018 fi
0019 
0020 #mLineCnt=0
0021 mOutLine=''
0022 while read mLine
0023 do
0024   mLineCnt=${mLineCnt}+1
0025 if [ ${mLineCnt} -eq 1 ]; then
0026     mOutLine=\'${mLine}
0027     else
0028     mOutLine=${mOutLine}\'\,\'${mLine}
0029     if [ ${mLineCnt} -eq $nlines ]; then
0030         echo ${mOutLine}\' >> $OUT_FILE
0031         mOutLine=''
0032         mLineCnt=0
0033     fi
0034 fi
0035 
0036 done < $IN_FILE
0037 if [ ${mLineCnt} -ne 0 ]; then
0038   echo ${mOutLine}\' >> $OUT_FILE
0039 fi