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

Re: Shell scripting



Pete Clarke declaimed:
> Hi there people,
> 
> I have a script that performs batch zipping of files. Trouble is that it
> only does one file at a time (kind of going against the "batch" idea).
> Could someone point out the silly mistake I am obviously making?
The core loop is clearly 

>         for file in "$1"
>  do
>             filename=${file%.*}
>             echo "Adding $file to $filename.zip..."
>             $ZIP $ARGS "$filename" "$file" > /dev/null
> 
>             let "nofiles += 1"
>         done

Hint: try quoting your args when you run the script. Read the bash docs,
have fun.

PM
-- 
Paul Mackinney
paul@mackinney.net



Reply to: