Next Hold Space 12

ed regexes

  • Just /re/ would find the next line in the file that matched

  • /re/command would find a matching line and execute the command

  • g/re/command would execute the command globally

    • that is, on each matching line

  • If the command was p, it would print the matching line:

     g/re/p     # print all lines maching a pattern
  • And that's where we get the word "grep"

        GREP(1)                                                                 GREP(1)
        
        NAME
               grep – print lines matching a pattern

Next Next