[vorbis-dev] [fwd] CVS: ogg123 rocks! vcut no so much so...(from: wayfarer42@postmaster.co.uk)

kcarnold-vorbisdev at arnoldnet.net kcarnold-vorbisdev at arnoldnet.net
Fri Aug 2 09:44:55 PDT 2002


On Fri, Aug 02, 2002 at 10:00:39AM +0200, Segher Boessenkool 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...).
> 
> Because we already have "xargs" to handle cases like that ;)

xargs splits on whitespace. From what I can tell, there's no way to
give it an explicit delimiter, at least judging from the manpage (I
haven't yet checked the source). But that's okay, because a simple
little trick with tr fixes it (see it in action in my reply that
didn't get attached to this thread):

cat playlist | tr "\n" "\0" | xargs -0 command

Replace the "\n" with the delimiter of your choice, and you have a
delimited xargs. Unix: simple programs combined in flexible ways. Oh
wait, that reminds me -- to make this message not completely
off-topic, I need to make a command-line interface to libao (aoplay or
something, if it doesn't already exist), so ogg123 can become:

#!/bin/sh
[ $# -eq 0 ] && echo "Usage: $0 <ogg> ..."
whille [ $# -gt 0 ]; do
  oggdec some-args $1 | aoplay some-more-args;
  shift;
done

:)


-- 
Kenneth Arnold <ken at arnoldnet.net>
- "Know thyself."


-------------- 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/20020802/180766e7/part.pgp


More information about the Vorbis-dev mailing list