[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash question

On Tue, July 01 at  2:46 AM EDT
Stephan Sauerburger <stephan@sauerburger.org> wrote:

>So how can one have the for loop separate the elements of the list only
>by newlines ("\n"), filling the contents of "file" with the whole line,
>and not separate by spaces, tabs, or other white space?

You'll probably get a million responses from this as someone asks it
about every 3 months.  I guess the simplest answer is to protect your
expanded variable name with double quotes.

for file in `ls`
do mpg123 "$file"


Shawn Lamson
Debian GNU/Linux 3.0

Reply to: