Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-amd64
Navigation:
Lists: gentoo-amd64: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-amd64@g.o
From: "Maciej Kazulak" <kazulakm@...>
Subject: Re: How to use &&
Date: Sun, 4 Jan 2009 15:31:10 +0100
2009/1/4 Paul Stear <span dir="ltr">&lt;<a href="mailto:gentoo@...">gentoo@...</a>&gt;</span><br><div class="gmail_quote"><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="Wj3C7c">On Sunday 04 January 2009 12:33:27 Martin Herrman wrote:<br>
&gt; On Sun, Jan 4, 2009 at 1:30 PM, Paul Stear &lt;<a href="mailto:gentoo@...">gentoo@...</a>&gt; wrote:<br>
&gt; &gt; Hello all,<br>
&gt; &gt; I have the following command which works well..<br>
&gt; &gt; mp3gain --auto /home/&quot;Fred Music&quot;/mp3/B*/*.mp3<br>
&gt; &gt;<br>
&gt; &gt; I want to expand this so overnight I can get more directories completed.<br>
&gt; &gt; I tried the following but it only did the directories starting &quot;B&quot;, the<br>
&gt; &gt; sequence after the &amp;&amp; just wasn&#39;t actioned. &nbsp;I have looked at bash docs<br>
&gt; &gt; but can&#39;t find anything relevent (probably staring me in the face).<br>
&gt; &gt; mp3gain --auto /home/&quot;Fred Music&quot;/mp3/B*/*.mp3 &amp;&amp; mp3gain --auto<br>
&gt; &gt; /home/&quot;Fred Music&quot;/mp3/C*/*.mp3 &amp;&amp; mp3gain --auto /home/&quot;Fred<br>
&gt; &gt; Music&quot;/mp3/D*/*.mp3<br>
&gt; &gt;<br>
&gt; &gt; Any ideas?<br>
&gt; &gt; Paul<br>
&gt;<br>
&gt; Hi Paul,<br>
&gt;<br>
&gt; I have created some shell scripts that execute some operations on my<br>
&gt; ogg/mp3 file collection. I use &#39;find&#39; to create a list of all my files<br>
&gt; and next process them. Ogg2mp3 also uses all of your cores. You might<br>
&gt; use these scripts and adapt them to your needs:<br>
&gt;<br>
&gt; <a href="http://www.herrman.nl/index.php?item=ogg2mp3tagfiles" target="_blank">http://www.herrman.nl/index.php?item=ogg2mp3tagfiles</a><br>
&gt;<br>
&gt; HTH,<br>
&gt;<br>
&gt; Martin<br>
<br>
</div></div>Thanks for your reply Martin. &nbsp;I have looked at your scripts and I might be<br>
able to use then in the future. &nbsp;My main problem is that my collection is so<br>
large, e.g 3104 files just in the directory beginning with &quot;D&quot; and that take<br>
about 4+ hours to run. So I could do with operating on 3 &nbsp;directories<br>
overnight.<br>
I must be able to add commands to be operated on in sequence.<br>
<div><div></div><div class="Wj3C7c"><br>
Any ideas?<br>
<br>
Paul<br>
<br>
--<br>
This message has been sent using kmail with gentoo linux<br>
</div></div></blockquote><div><br></div></div><br>The reason only the first command was executed can be that it returned a non-zero exit status. If you want to make sure every command gets a chance to execute, regardless of what the exit status of the previous one is, substitute &#39;&amp;&amp;&#39; with &#39;;&#39;. Check this out:<br>
box% false &amp;&amp; echo &quot;will not be echoed&quot;<br>box% false; echo &quot;hello&quot;<br>hello<br>box%<br><br>That&#39;s how bash evaluates logic expressions. There&#39;s even a fancy word for it i think. Point is it will execute commands only to the point where it can determine the logic result. So above if the first element is false there&#39;s no need to execute echo as the logic result is already known to be false.<br>
Replies:
Re: How to use &&
-- Richard Freeman
Re: How to use &&
-- Martin Herrman
References:
How to use &&
-- Paul Stear
Re: How to use &&
-- Martin Herrman
Re: How to use &&
-- Paul Stear
Navigation:
Lists: gentoo-amd64: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: How to use &&
Next by thread:
Re: How to use &&
Previous by date:
Re: How to use &&
Next by date:
Re: How to use &&


Updated Jun 17, 2009

Summary: Archive of the gentoo-amd64 mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.