Thanks Karl that was easy.<br><br>if [ -d /home/nathan/test2/123 ]<br>then<br>rm -r 123<br>echo &quot;123 deleted&quot;<br>else<br>echo &quot;123 not found&quot;<br>fi<br><br>if [ -d /home/nathan/test2/456 ]<br>then<br>rm -r 456<br>
echo &quot;456 deleted&quot;<br>else<br>echo &quot;456 not found&quot;<br>fi<br><br>Cheers,<br><br>Nathan.<br><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 9:23 AM, Karl Lattimer <span dir="ltr">&lt;<a href="mailto:karl@qdh.org.uk">karl@qdh.org.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Fri, 2010-07-16 at 09:17 +0100, Nathan Friend wrote:<br>
&gt; Morning,<br>
&gt; I would like a simple bash script to check if a list of user<br>
&gt; directories exist and if they do delete them.  If they don&#39;t output a<br>
&gt; message and skip to next folder to check.  E.g.<br>
&gt;<br>
&gt; Does /Home/user1 exist &gt; Yes &gt; Delete /home/user1 goto next check<br>
&gt;                                        No  &gt; &quot;user1 not found&quot; go to<br>
&gt; next check<br>
&gt; Does /Home/user2 exist &gt; Yes &gt; Delete home/user2 goto next check<br>
&gt;                                        No &gt; &quot;user2 not found&quot; go to<br>
&gt; next check<br>
&gt; end.<br>
&gt;<br>
&gt; Any ideas how I can do this?<br>
<br>
</div></div>if [ -d /path/to/dir ]<br>
then<br>
echo &quot;exists&quot;<br>
fi<br>
<br>
K,<br>
<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Nathan.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Kent mailing list<br>
&gt; <a href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a><br>
&gt; <a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Kent mailing list<br>
<a href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a><br>
</blockquote></div><br>