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"
done
HTH
Shawn Lamson
shawn.lamson@verizon.net
Debian GNU/Linux 3.0
Reply to:
- References:
- Bash question
- From: Stephan Sauerburger <stephan@sauerburger.org>