#!/bin/ksh 

stream_file=/proj/cdsoa/tsmc018bcd/ca10a/workarea/strmOut.log
temp_file=/tmp/dev.txt
temp1_file=/tmp/dev1.txt
my_path=/tmp/stream_device.txt
[ -f ${temp_file} ] && \rm ${temp_file}
[ -f ${temp1_file} ] && \rm ${temp1_file}
[ -f ${my_path} ] && \rm ${my_path}


if [ "$(cat /proj/cdsoa/tsmc018bcd/ca10a/workarea/strmOut.log | grep 'tsmc18_Dig')" != "" ] ; then echo | awk '{printf("nmos2v\npmos2v\n")}' >${my_path} ; fi
if [ "$(cat /proj/cdsoa/tsmc018bcd/ca10a/workarea/strmOut.log | grep 'tsmc18dig5V')" != "" ] ; then echo | awk '{printf("nmos5v\npmos5v\n")}' >>${my_path} ; fi

grep "tsmc18" ${stream_file} | grep -v "tsmc18_Dig" | grep -v "tsmc18dig5V"|  grep -v "techLib" |  grep -v "layermap"| awk '{print $6'} | sed -e 's/tsmc18//' | sed -e 's/layout//' | sed -e 's/\///' | sed -e 's/\///' >> ${temp_file}
grep -v "M2_M1" ${temp_file} > ${temp1_file}
grep -v "M3_M2" ${temp1_file} > ${temp_file}
grep -v "M4_M3" ${temp_file} > ${temp1_file}
grep -v "M5_M4" ${temp1_file} > ${temp_file}
grep -v "M1_PACTIVE" ${temp_file} > ${temp1_file}
grep -v "M1_NPOLY1" ${temp1_file} > ${temp_file}
grep -v "M1_NWELL" ${temp_file} > ${temp1_file}
grep -v "M1_PPOLY1" ${temp1_file} > ${temp_file}
grep -v "M1_SUB" ${temp_file} >> ${my_path}


#nedit ${my_path}&
