title: executing current line then search for next and execute
body: <p>hi i have a file with this content</p>
  
  <pre><code> mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE add_customer\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE add_order\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE add_to_cart\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE add_to_wish_list\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE add_transaction\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE clear_cart\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE get_order_contents\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE get_shopping_cart_contents\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE get_wish_list_contents\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE receipt_retrieve\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE remove_from_cart\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE remove_from_wish_list\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE select_categories\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE select_products\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE select_sale_items\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE update_cart\G'
   mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE update_wish_list\G'
  </code></pre>
  
  <p>I want to use a function to execute each line and replace with the command output, then search for the next line that begins with "mysql" and execute that line.. until the end of the file.</p>
  
  <p>here is my function</p>
  
  <pre><code>r !mysql -uroot -ppass sas -e 'SELECT name FROM mysql.proc;'
      normal! gg /name&lt;CR&gt;n
      normal! dd
      %normal! I mysql -uroot -ppass sas -e 'SHOW CREATE PROCEDURE 
      normal! ggdd0 
      %normal A\G'
      normal! gg0
      normal! G
      let lastline = line(".")
      echom lastline 
      normal! gg0
  "here is where i want to start
      .!sh
  **"back to normal to search**
      normal! /mysql&lt;CR&gt; n 
  **"when found execute the line**
      %normal !!sh
      ".!sh
  endfunction
  </code></pre>
  
  <p>This works for the first line but i cant figure out how to do the whole range of lines. I know im close.. </p>