Monday, May 10, 2010

Sample Shell Script

#!/bin/sh

date > monitor.in

file1=./

date=`echo $file1 awk -F "_" '{print $2}' awk -F "." '{print $1}'`

#echo "EVENT_TYPESDR_TYPESDR_OPERATION_TIME_LOCALMSG_IDSUBMIT_TIME_LOCALVALIDITY_PERIODMESSAGE_SIZEA_TYPEA_MSISDNB_TYPEB_MSISDN" > SDR_filter_$date.unl

while read linef1
do

readLine=`echo $linef1 awk -F "," '{print $4""$5""$6""$10""$11""$12""$14""$22""$24""$30""$32}'`
echo $readLine >> SDR_filter_$date.unl

done < $file1 date >> monitor.in


ps. any question about script, please drop in comments section.

No comments:

Post a Comment