Mailinglist Archive: opensuse (4288 mails)

< Previous Next >
Re: [SLE] Script error...
On Wed, 2002-05-01 at 20:14, Rikard DustPuppy Johnels wrote:
> cd /mnt/extra1/files
> for i in /home/lucifer/download do
> bunzip2 %i
> done
>
> But as i get to line 2 it burps me a
> bash: syntax error near unexpected token `bunzip2'

Try this:
cd /mnt/extra1/files
for i in /home/lucifer/download/*.bz2; do
bunzip2 $i
done

The shell expands "/home/lucifer/download/*.bz2" to the list of file
names. The semi-colon tells Bash it's reached the end of the list.

--
Robert Wohlfarth
rjwohlfar@xxxxxxxxxxxxxxxxxx

"Is not life more important than food, and the body more
important than clothes?" -- Matthew 6:25b


< Previous Next >
References