Kenneth C. Arnold
2002-Aug-01 15:51 UTC
[: Re: [vorbis-dev] [fwd] CVS: ogg123 rocks! vcut no so much so... (from: wayfarer42@postmaster.co.uk)]
For some reason this didn't make the list and I got no approval message... this time I'll force the From to be my subscribed address. Bug in Monty's new filtering system? Anyway, here goes again. ----- Forwarded message from ----- Date: Thu, 1 Aug 2002 10:24:46 -0400 To: vorbis-dev@xiph.org Subject: Re: [vorbis-dev] [fwd] CVS: ogg123 rocks! vcut no so much so... (from: wayfarer42@postmaster.co.uk) Message-ID: <20020801142446.GA11307@arnoldnet.net> References: <Pine.GSO.4.33.0208011238430.21715-100000@techst02.technion.ac.il> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <Pine.GSO.4.33.0208011238430.21715-100000@techst02.technion.ac.il> User-Agent: Mutt/1.4i Status: RO On Thu, Aug 01, 2002 at 12:41:52PM +0300, Beni Cherniavksy wrote:> As Segher once pointed out, unix tools need no playlist support: > ogg123 `cat playlist` does the job (unless you spaces in file names, I wonder > why bash has no split-by-lines command substitution variant...). Using > ls, find, vorbiscomment instead of cat you can have dynamic playlists windows > users don't even dream of...[...]> That would be broken, it would mean the -@ treats all rememaining arguments > as playlists. ogg123 `for f in *.m3u; do echo -@ $f; done` will produce the > needed command line. But in the spirit of Segher's idea, ogg123 `cat *.m3u` > should work (modulo spaces, again) and ogg123 -@ <(cat *.m3u) is good too > (bash has this nifty temporal named pipe feature, don't know for other shells).[...]> Again, ogg123 `ls *.ogg` or ogg123 `find -name '*.ogg' | sort` should do. > "A program should do one thing and do it well."Ah, the wonder of Unix. The -print0, -0, and -z below all do the same thing--end filenames with '\0' instead of '\n' or ' '. The tr command makes newlines into '\0' for playlists that delimit by newline. Everything should be standard for any Unix system and should run in any POSIX-compliant shell (if not, yell at me): 1. All oggs under '.', unsorted: find . -name '*.ogg' -print0 | xargs -0 ogg123 2. All oggs under '.', sorted by name: find . -name '*.ogg' -print0 | sort -z | xargs -0 ogg123 3. All oggs under '.', sorted by starting number find . -name '*.ogg' -print0 | sort -z -n | xargs -0 ogg123 4. Playlist, unsorted (m3u format): tr "\n" "\0" < ${PLAYLIST} | xargs -0 ogg123 5. Playlist, unsorted (m3u format), oggs only: grep ogg < ${PLAYLIST} | tr "\n" "\0" | xargs -0 ogg123 6. Playlist, unsorted (pls format): grep 'File\([0-9]\+\)=' < ${PLAYLIST} | cut -d '=' -f 2- | tr "\n" "\0" | xargs -0 ogg123 There's certainly more, but I think that should satisfy the cut-and-paste needs of most of the command line Unix Ogg-ers out there. None of these are fully tested, so you might have to tweak one thing or another. Oh, one more: 7. Search for a comment among files in a playlist (rather slow) (while read filename; do if vorbiscomment -l "$filename" | grep ${SEARCHSTRING}; then echo "$filename"; ogg123 "$filename"; fi; done) < ${PLAYLIST} <p> -- Kenneth Arnold <ken@arnoldnet.net> - "Know thyself." <p><p>----- End forwarded message ----- -------------- next part -------------- A non-text attachment was scrubbed... Name: part Type: application/pgp-signature Size: 190 bytes Desc: not available Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20020801/d3e00e06/part-0001.pgp