#!/bin/bash for i in $(ls); do zip -j $i.zip $i done The above is supposed to be a script for zipping all files in a directory into separate archives, each named the same thing as the file. This only works for names with no spaces, though; how do I fix this so that it handles filenames with spaces in them?