Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your example output (minus the extra open-paren) is all you need then I think your script is over-kill. How about this?</p> <pre><code>#! /bin/awk -f { if ($2 ~ /[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]/ ) { funcName=$3 argSig=$0 srchTarg= "^.*" funcName sub(srchTarg,"",argSig) # print "argSig=" argSig sub(/[\)].*$/, ")", argSig) # print "argSig=" argSig print "DROP FUNCTION " funcName argSig } } </code></pre> <p>be sure to <code>chmod 755 genDrop.awk</code></p> <p><strong>sample run</strong></p> <p>(I changed the first line of your sample input to )</p> <blockquote> <p>CREATE FUNCTION folder_cycle_check (....</p> </blockquote> <p><strong>sample run</strong></p> <pre><code>$ genDrop.awk dropFunction.txt DROP FUNCTION folder_cycle_check (folder_key INTEGER, new_parent_folder_key INTEGER) </code></pre> <p>Also, naming your awk script as genDrop.txt has not helped in communicating what your intention is, surely you mean genDrop.awk</p> <p>I hope this helps.</p> <p>Allow me to welcome you to StackOverflow and remind three things we usually do here: 1) As you receive help, try to give it too, answering questions in your area of expertise 2) Read the FAQs, <a href="http://tinyurl.com/2vycnvr" rel="nofollow">http://tinyurl.com/2vycnvr</a> , 3) When you see good Q&amp;A, vote them up by using the gray triangles, <a href="http://i.stack.imgur.com/kygEP.png" rel="nofollow">http://i.stack.imgur.com/kygEP.png</a> , as the credibility of the system is based on the reputation that users gain by sharing their knowledge. Also remember to accept the answer that better solves your problem, if any, by pressing the checkmark sign , <a href="http://i.stack.imgur.com/uqJeW.png" rel="nofollow">http://i.stack.imgur.com/uqJeW.png</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload