Hi All,
I need script which should search for the "reason code" and it should send mail with its preceding line as well as the line below it.(first line before it and line after it)
I used below script but it is printing the whole lines inside it, your help is appreciated:
cd /app/usr/bin
grep -i 'reason code' system.log > queue_line.txt
( cat queue_line.txt ) | mailx -s "reason code"
hello@gmail.com
system.log :
=========
Feb 13 21:47:14 app20 please enter the valid input. system cannot understnd the queue you entered
reason code 2085. from the default values.
The Create MQ Channel (CRTMQMCHL) command creates a new MQ channel definition, specifying those attributes that are to be different