Re: Bash question
On Tuesday 01 July 2003 3:18 pm, Colin Watson wrote:
> There's one mistake in the above even before looking at the contents of
> "#stuff", namely that you shouldn't be using ls here. Have a look at
> this document written by a friend of mine:
> http://www.greenend.org.uk/rjk/2001/04/shell.html
Thanks for this article, it's cool.
It's true in this case you wouldn't use ls but *. However, there are other
times when you want your loop to iterate over the results of other program
other that ls, and the question remains valid to these cases.
One solution is setting the IFS as I mentioned earlier, but should be other
solutions maybe more elegant.
Anyway when I want to hear music with mpg123 I use:
find . -iname "*mp3" -exec mpg123 '{}' \;
But if you really want to get over this, install music123 and you would have
all this issues solved for you. You can even play it in random order, make it
descend dirs, plays wav, ogg and mp3, and it's all from console, not even a
ncurses menu. Cool !!! ;-)
Reply to: