On 2013-04-01 10:21, Chris Down wrote:
> snip
Slightly faster method so that we don't iterate after we know the position of
the pivot:
deleteOld() {
local newFile oldFile found
local oldFiles=()
local newFiles=()
while (( $# )); do
if [[ "$1" == "" ]]; then
newFiles=( "${@:2}" )
break
fi
oldFiles+=( "$1" )
shift
done
for oldFile in "address@hidden"; do
found=0
for newFile in "address@hidden"; do
if [[ "$oldFile" == "$newFile" ]]; then
found=1
break
fi
done
(( found )) || rm "$oldFile"
done
}
Also $arg, $newFile, $oldFile and $found should have been local in my first
posting.
Chris