Menu

grep help

Help
2005-08-01
2012-07-26
  • Nobody/Anonymous

    how can I use grep to find: myFunction(any_string_or_char) in a file?
    Thank you
    Doru.

     
    • Keith Marshall

      Keith Marshall - 2005-08-01

      $ cat tst.txt
      MyFunction( "some text" );
      AnotherFunction( "some more text" );
      MyFunction( "yet more text" );

      $ grep "MyFunction(.*)" tst.txt
      MyFunction( "some text" );
      MyFunction( "yet more text" );

      Works for me.

      HTH.
      Keith.

       
    • Nobody/Anonymous

      With GnuWin32 Grep (curent ver.) in not working (for me).
      I whant to search for MyFunction() regardless what ar the parameters betwee (...) I think I should use the grep with regex, but I know little about regex.
      Doru

       
MongoDB Logo MongoDB