how to make this work

hi,

I have been trying to make my script work but could not, tried some of the suggestions from here but I am not getting the correct result.

I have a script that was

Param1 ="$1"
Param2 ="$2"

$Script1 log -t "$param1" "$param2" | grep operation > /dev/null || {
echo "Message" >&2
exit 1 }

exit 0

Now I need to introduce a function in place of grep operation

something like

{
awk ' / dgdg/
..
END {
if(condition)
{
I should exit out like Exit 0
}
else
{
I am unable to pull in the operation
|| { echo "Message" >&2 exit 1}

                  \}

            \}' 

}

Please suggest how we can get

I figured out the answer my self, We can redirect the Message at "else " part using print"***Message***" >"&2"

at
awk' ....
If (){

      \}

     else\{
        
      print"\*\*\*Message***" >"&2"

       \} ' 

Simple :wink: