Shell Expansion in Bourne Shell Script Question
On 28.07.2010 20:05, Karl Vogel wrote:
On 28.07.2010 14:42, Jochen Schulz wrote:
J> I think you meant to write
J> for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]`
J> Another hint: you don't need 'ls' for your case at all.
I'd recommend keeping the "ls". Try your script when MAGDIR doesn't
have any zipfiles, and MAGFILE will hold the expanded value of $MAGDIR
with the string "*.[Zz][Ii][Pp]" appended. Bash, sh, and ksh all do
that for some dopey reason, which is why I would do
for file in $(ls $MAGDIR/*.[Zz][Ii][Pp] 2> /dev/null); do ...
if there's any chance that you won't find any files.
Now that's an odd one! Didn't know that.
One might be better of with some like this:
find /DIR -regextype posix-egrep -regex '.*.(zip|ZIP)' -exec
some_command {} +
Best regards
Mart
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4C50A7F3.9040502@chello.at">http://lists.debian.org/4C50A7F3.9040502@chello.at
Thu Jul 29 00:30:02 2010
Return-path: <devel-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Thu, 29 Jul 2010 00:15:39 +0300
Received: from bastion02.fedoraproject.org ([209.132.181.3]:47146 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <devel-bounces@lists.fedoraproject.org>)
id 1OeDyV-00060h-43
for tom@linux-archive.org; Thu, 29 Jul 2010 00:15:39 +0300
Received: from lists.fedoraproject.org (collab1.vpn.fedoraproject.org [192.168.1.21])
by bastion02.phx2.fedoraproject.org (Postfix) with ESMTP id C5EF7110774;
Wed, 28 Jul 2010 22:00:06 +0000 (UTC)
Received: from collab1.fedoraproject.org (localhost.localdomain [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 85C083267A7;
Wed, 28 Jul 2010 22:00:05 +0000 (UTC)
X-Original-To: devel@lists.fedoraproject.org
Delivered-To: devel@lists.fedoraproject.org
Received: from smtp-mm3.fedoraproject.org (smtp-mm3.fedoraproject.org
[152.46.7.226])
by lists.fedoraproject.org (Postfix) with ESMTP id F00DE32679E
for <devel@lists.fedoraproject.org>;
Wed, 28 Jul 2010 22:00:02 +0000 (UTC)
Received: from mail-wy0-f173.google.com (mail-wy0-f173.google.com
[74.125.82.173])
by smtp-mm3.fedoraproject.org (Postfix) with ESMTP id 3DCFF37DAD
for <devel@lists.fedoraproject.org>;
Wed, 28 Jul 2010 22:00:02 +0000 (UTC)
Received: by wyi11 with SMTP id 11so4428855wyi.32
for <devel@lists.fedoraproject.org>;
Wed, 28 Jul 2010 15:00:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.175.143 with SMTP id z15mr11269611wel.64.1280354401491;
Wed, 28 Jul 2010 15:00:01 -0700 (PDT)
Received: by 10.216.180.7 with HTTP; Wed, 28 Jul 2010 15:00:01 -0700 (PDT)
In-Reply-To: <1280353120.20253.4.camel@vaioz.local.net>
References: <4C4F554C.7030103@gmail.com> <4C4F5760.9070106@gmail.com>
<alpine.LFD.2.00.1007271707380.2911@laptop1.mmcgra th.net>
<4C4F5989.500@gmail.com>
<AANLkTimFnf1bXyZyt4feNsdAaR_0nRyJc3DuzcYN2wsZ@mai l.gmail.com>
<4C501A38.2000100@louiz.org>
<alpine.LFD.2.00.1007280746560.2546@laptop1.mmcgra th.net>
<4C502AEE.2090708@louiz.org>
<20100728153701.GF16445@victoria.internal.frields. org>
<1280337035.2038.18.camel@adam.local.net>
<4C5072B1.3020207@redhat.com>
<alpine.LFD.2.00.1007281324450.2546@laptop1.mmcgra th.net>
<4C507A03.7000107@redhat.com>
<alpine.LFD.2.00.1007281342080.2546@laptop1.mmcgra th.net>
<AANLkTi=nDKyD1-maC9QgtGCeXnHOxBmfxo-DhmAbbLL_@mail.gmail.com>
<alpine.LFD.2.00.1007281354110.2546@laptop1.mmcgra th.net>
<AANLkTinVVomCzN6N9pYjCDJx5L8shSj=dP67zrsDcAxa@mai l.gmail.com>
<AANLkTikhoPX1D4cjJD5g_24n9v27WbFENWpPr7jecbB=@mai l.gmail.com>
<4C5099EC.6020509@redhat.com>
<1280352534.2759.113.camel@localhost.localdomain >
<1280353120.20253.4.camel@vaioz.local.net>
Date: Wed, 28 Jul 2010 17:00:01 -0500
Message-ID: <AANLkTin4T7FTY02k0tnK+XA7SYuRBVzHT=KfXVk6o1dP@mai l.gmail.com>
Subject: Re: Firefox 4 for Fedora 14?
From: =?ISO-2022-JP?B?Q29uYW4gS3VkbyAoGyRCJUshPCVrISYlNCVzJVEbKEIp? =
<ngompa13@gmail.com>
To: Development discussions related to Fedora <devel@lists.fedoraproject.org>
X-BeenThere: devel@lists.fedoraproject.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
List-Id: Development discussions related to Fedora
<devel.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/devel>
List-Post: <mailto:devel@lists.fedoraproject.org>
List-Help: <mailto:devel-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1883368148581617699=="
Sender: devel-bounces@lists.fedoraproject.org
Errors-To: devel-bounces@lists.fedoraproject.org
--===============1883368148581617699==
Content-Type: multipart/alternative; boundary=001485f1e2ee4999c3048c79bda4
--001485f1e2ee4999c3048c79bda4
Content-Type: text/plain; charset=ISO-8859-1
On Wed, Jul 28, 2010 at 4:38 PM, Adam Williamson <awilliam@redhat.com>wrote:
On Wed, 2010-07-28 at 23:28 +0200, Martin Sourada wrote:
> Speaking of which, is there any chance to split ffmpeg into free (which
> could be included in fedora) and nonfree part? IIRC we've done something
> like that with xine-lib-extras and gst-plugins-bad in the past...
ffmpeg, unfortunately, isn't set up to be modularised like this; you
can't build an ffmpeg-free with the free codecs and an ffmpeg-patented
with the patented ones and have them co-exist nicely. So an ffmpeg build
with almost all the codecs ripped out in the Fedora repos would
'compete' with the full build in That Other Repo, not complement it, and
the way the two repos are set up, it would be tricky to have a
handicapped build in the Fedora repo and a full build in That Other One
and have it easy for people to pick the one from That Other Repo (since
Other Repo packages use the same disttag as Fedora ones).
--
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Fedora Talk: adamwill AT fedoraproject DOT org
http://www.happyassassin.net
That is assuming that "the other repo" uses the same name as Fedora's.
Fedora could call it ffmpeg-free, and "the other repo" could call it
ffmpeg-nonfree, and have the nonfree one obsolete the free one. Simple fix,
I think.
--001485f1e2ee4999c3048c79bda4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Wed, Jul 28, 2010 at 4:38 PM, Adam Williamson <span dir=3D"ltr"><<a h=
ref=3D"mailto:awilliam@redhat.com">awilliam@redhat .com</a>></span> wrote=
:<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Wed, 2010-07-28 at 23:28 +0200, Martin Sourada wrote:<=
br>
<br>
> Speaking of which, is there any chance to split ffmpeg into free (whic=
h<br>
> could be included in fedora) and nonfree part? IIRC we've done som=
ething<br>
> like that with xine-lib-extras and gst-plugins-bad in the past...<br>
<br>
</div>ffmpeg, unfortunately, isn't set up to be modularised like this; =
you<br>
can't build an ffmpeg-free with the free codecs and an ffmpeg-patented<=
br>
with the patented ones and have them co-exist nicely. So an ffmpeg build<br=
with almost all the codecs ripped out in the Fedora repos would<br>
'compete' with the full build in That Other Repo, not complement it=
, and<br>
the way the two repos are set up, it would be tricky to have a<br>
handicapped build in the Fedora repo and a full build in That Other One<br>
and have it easy for people to pick the one from That Other Repo (since<br>
Other Repo packages use the same disttag as Fedora ones).<br>
<div class=3D"im">--<br>
Adam Williamson<br>
Fedora QA Community Monkey<br>
IRC: adamw | Fedora Talk: adamwill AT fedoraproject DOT org<br>
<a href=3D"http://www.happyassassin.net" target=3D"_blank">http://www.happy=
assassin.net</a><br>
<br></div></blockquote><div><br></div><div>That is assuming that "the =
other repo" uses the same name as Fedora's. Fedora could call it f=
fmpeg-free, and "the other repo" could call it ffmpeg-nonfree, an=
d have the nonfree one obsolete the free one. Simple fix, I think.=A0</div>
</div>
--001485f1e2ee4999c3048c79bda4--
--===============1883368148581617699==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
--===============1883368148581617699==--
|