Solutions to Exercises

Solution 2.1

Start at virtual address line 0 and search backwards to find the last line containing “EXPORT”:

  :0 ?EXPORT? delete

Solution 2.2

  1. Starting at virtual address line 0 which includes a match on line 1:

      :0 /EXPORT/ delete
    
  2. Starting at virtual address line $ (last line) and searching forward, wrapping around the buffer to find the first line containing “EXPORT”:

      :$ /EXPORT/ delete
    

Solution 2.3

Use a positive numeric offset of +1 to move one line past the ?abc? search and a negative numeric offset of -1 to move one line prior to the /xyz/ search:

  ?abc?+1 , /xyz/-1 delete