title: Is there a better way to grep than using these four commands thrown together?
body: <p>Essentially what I'm trying to do is parse through some files on my system and pull out a few different things from each file.  Here is how I'm currently doing this:</p>
  
  <pre><code>grep -oP "((?&lt;=set_kb_item\(name:)(.*?)(?=, value:))" *.nasl &gt;&gt; /tmp/set_kb_items.txt &amp;&amp; 
  grep -oP "((?&lt;=user = )(.*?)(?=;))" *.nasl &gt;&gt; /tmp/usernames.txt &amp;&amp; 
  grep -oP "((?&lt;=dependencies\()(.*?)(?=\)))" *.nasl&gt;&gt; /tmp/dependencies.txt &amp;&amp; 
  grep -oP "((?&lt;=script_set_attribute\(attribute:\"plugin_type\", value:)(.*?)(?=\)))" *.nasl &gt;&gt; /tmp/plugin_type.txt &amp;&amp; 
  grep -oP "((?&lt;=script_require_ports\()(.*?)(?=\)))" *.nasl &gt;&gt; /tmp/required_ports.txt 
  </code></pre>
  
  <p>This works perfect for me, and it finishes in about two minutes (70k files).  However, I'm curious if I can chain these together a different way?  My end goal here is to take this string, and do the equivalent in python, and then send these values to a database, but I'm not quite there yet.  Any input would be appreciated, thanks!</p>