Ya. Do it using python. Why do you want to use bash when you already have python?<br><br>See, do something like this:- <br><br>import os<br>alldirs = os.listdir(&quot;/path/to/dir&quot;)<br><br>DIRS = [] #Only the dirs you are interested in<br>

<br>for i in alldirs:<br>      if i.find(&quot;deploy&quot;) is -1: L.append(i)<br>      if i.find(&quot;TEMPLATE&quot;) is -1: L.append(i)<br><br>#Now L contains all the required dirs.<br><br>Hope it helps.<br><br><div class="gmail_quote">

On Tue, Oct 26, 2010 at 9:19 PM, Sean Carolan <span dir="ltr">&lt;<a href="mailto:scarolan@gmail.com">scarolan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">&gt; Here is the bash one-liner that generates my list,<br>
&gt; with one name per line:<br>
&gt;<br>
&gt; ls -d */ | grep -v -E &#39;deploy|TEMPLATE&#39; | sed &#39;s/\///&#39;<br>
&gt;<br>
&gt; How would you get the output of this into a python list that could<br>
&gt; then be used in the script?  Please forgive my ignorance; I&#39;ve read<br>
&gt; through the documentation but am still not clear on this aspect.<br>
<br>
</div>Would this be easier to accomplish using os.listdir()?.  Basically I<br>
want to make a list of directories, excluding files and the<br>
directories or files containing &quot;deploy&quot; and &quot;TEMPLATE&quot;.<br>
</blockquote></div><br><br clear="all"><br>-- <br>Abhijeet Rastogi (shadyabhi)<br><a href="http://www.google.com/profiles/abhijeet.1989" target="_blank">http://www.google.com/profiles/abhijeet.1989</a><br>