FAQ Title: Defining a class if a string is found in a file Keywords: define class string file Classes: any Section: Classes and variables If you want to define a class based on finding a string inside a file, then do NOT use 'editfiles', as it will define classes only if some editing took place on that file. What you have to do is to use 'ReturnsZero', but the tricky part is to use it properly, here is the format:
classes:
   class_you_want_to_define = ( ReturnsZero(/bin/sh -c '/bin/grep "STRING TO LOOK FOR" /file/to/look/in > /dev/null 2>&1') )
Pay special attention to the use of single quotes, double quotes and the redirection of the stdout and stderr.