From owner-freebsd-questions@FreeBSD.ORG Wed Dec 30 01:57:36 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7278C106568F for ; Wed, 30 Dec 2009 01:57:36 +0000 (UTC) (envelope-from neshort@yahoo.com) Received: from n76.bullet.mail.sp1.yahoo.com (n76.bullet.mail.sp1.yahoo.com [98.136.44.48]) by mx1.freebsd.org (Postfix) with SMTP id 3D3EC8FC1D for ; Wed, 30 Dec 2009 01:57:36 +0000 (UTC) Received: from [216.252.122.216] by n76.bullet.mail.sp1.yahoo.com with NNFMP; 30 Dec 2009 01:44:37 -0000 Received: from [68.142.237.89] by t1.bullet.sp1.yahoo.com with NNFMP; 30 Dec 2009 01:44:36 -0000 Received: from [66.196.97.153] by t5.bullet.re3.yahoo.com with NNFMP; 30 Dec 2009 01:44:36 -0000 Received: from [127.0.0.1] by omp206.mail.re3.yahoo.com with NNFMP; 30 Dec 2009 01:44:36 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 781098.81737.bm@omp206.mail.re3.yahoo.com Received: (qmail 15176 invoked by uid 60001); 30 Dec 2009 01:44:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1262137476; bh=Lp5LkPhINrJblM5hh9GLzrJ3Dwp5hhEW2oDDs0Wiyfg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=FMTgdyxDmrveXaNKMsRrdjRZyeKyg5MnBqXePqr3q/bPYqWETMYkeeOGMVPy31QnI7Jdq3zEvqZqyVhEkNiDQIxKAazeouSQY4/QznNdvd2ogZJFP5NluCBizRiFGNfZa+MdCJLYzktqn/QqBY4jvmWAY/seJuN8U672MvV0UkA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=zBo8LEZ5moSGLDz5+t1F0obDku7PtrA4pBgNduVk+xEAfBUd6KO6/QLmUMK3CSchMg0LE4I85WPUf/CjzeKVkSSWvOpFJDmXYth/mXyjmELyXLT7Lop21O/AlO+fPEtuiLjGAflYZqWRO7sXGRfzw5OYUNORN3cwJex2gM3lsdg=; Message-ID: <679079.14827.qm@web56508.mail.re3.yahoo.com> X-YMail-OSG: LADsrkkVM1mUTFzLvLwxXyaYuEz64dN.gsJFEeTTHNXbsyY8I7Rg7yuc9BADWq6ZCD5WQUtSyULd1vI7pfpCBdo0X5J6Kv8wR3td14pfYXaF8RBUxEMyQvYzK0LZSA.5hX1Hy7C84KqmGm3Wnt2bfyM1Q3FPpBQk3ganhOM_yqjo2YnEPE4uR1E6wIll0wI9Z3PKVJpsxMm9zWx2Qcnp.puZPCb_HxBUAn3ILGwntgqA0uZBeF71uF6aE0mA0dXG3A9ZQ.ZemSBCIW30k6onbbcOAC4u4BpIrdXSQYXOwGKRUmzpeXugocUCI7Q44GsOhvFqBZL9x07u4QCSrl_uOQruixj8AKt74w-- Received: from [174.18.64.50] by web56508.mail.re3.yahoo.com via HTTP; Tue, 29 Dec 2009 17:44:36 PST X-Mailer: YahooMailClassic/9.0.20 YahooMailWebService/0.8.100.260964 Date: Tue, 29 Dec 2009 17:44:36 -0800 (PST) From: Neil Short To: freebsd-questions@freebsd.org In-Reply-To: <20091229171038.GJ98917@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Dan Nelson Subject: Re: mplayer / bash question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 01:57:36 -0000 =0A=0A--- On Tue, 12/29/09, Dan Nelson wrote:=0A= =0A> From: Dan Nelson =0A> Subject: Re: mplayer / = bash question=0A> To: "Neil Short" =0A> Cc: freebsd-ques= tions@freebsd.org=0A> Date: Tuesday, December 29, 2009, 10:10 AM=0A> In the= last episode (Dec 29), Neil=0A> Short said:=0A> > I'm trying to batch-rip = audio files from a bunch of=0A> video files.=0A> > =0A> > I have a director= y full of *.vob files:=0A> > =0A> > ls *.vob=0A> > 01.vob=A0 03.vob=A0 05.v= ob=A0 07.vob=A0=0A> 09.vob=A0 11.vob=A0 13.vob=0A> > 02.vob=A0 04.vob=A0 06= ..vob=A0 08.vob=A0=0A> 10.vob=A0 12.vob=0A> > =0A> > So I wrote a little com= mand line script to rip wave=0A> files from all the=0A> > vob's:=0A> > =0A>= > > ls *.vob |=0A> > > while read f=0A> > > do=0A> > > mplayer -ao pcm:fil= e=3D`basename $f .vob`.wav $f=0A> > > done=0A> > =0A> > the first 01.wav fi= le is created successfully; but=0A> then the whole sh'bang=0A> > exits with= out ripping the rest of the vob's:=0A> =0A> Try this instead:=0A> =0A> for = f in *.vob ; do=0A> mplayer -ao pcm:file=3D${f%.vob}.wav $f=0A> done=0A> = =0A> Uses the shell's native file globbing to expand the *.vob=0A> wildcard= , and the=0A> shell's native string processing functions to remove a=0A> su= ffix.=A0 If that=0A> still doesn't work, run the script with "sh -x" to tur= n=0A> debugging on, and=0A> see what your variables are expanding to as the= script=0A> runs.=0A> =0A> -- =0A> =A0=A0=A0 Dan Nelson=0A> =A0=A0=A0 dnels= on@allantgroup.com=0A> =0A=0AThanks! It actually works. I need to get me a = good book on the shell. The man pages are ... .=0A=0A=0A