Thanks for the reply.
I checked the differences between line and read command.
I used read command to read the line from file.
From this line i need to create a file which is used for awk.
Code :
while read linestr; do
param1=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\1/'`
param2=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\2/'`
param3=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\3/'`
echo '/'$param2'/{printf("'$param3' at %s\\n", substr($0,0,20))}' >> temp.sed
done < input.txt
The file input.txt looks like this
manager;2909,Order_MAIL : Invalid Mail Address|!manager,ERROR,Notice_MAIL:Invalid Mail Address found.
manager;ORA-2023|!manager,ERROR,ORA-04031 Occured.
manager; : Delete failed|!manager,ERROR,DatabaseGarbageCollect : Fail delete user id
MakeAllMailList;ORA-|!MakeAllMailList,ERROR,MakeAllMailList:Fail make AllMailList
Set;ORA-|!PlanSet,ERROR,PlanSet:Fail AccountSignupPlan PlanSet
Here i am getting proper values for param1 and param2. However i am getting empty for param3.
I am not able to find why i am not getting param3.
I did googling found the website
http://www.grymoire.com/Unix/Sed.html
but not able crack.
Please help.
Thanks and Regards
Pramod