I have the following code:
entries=("Wet\ Picnic" "Arizona\ Jones" "Bikeboy")
for arg in "${entries[@]}"; do ls -lh $arg.* ; done
It gives me 4 errors and 1 success. I'd really like it to give me 3 successes.
How do I handle the fact that the arguments to ls contain spaces (I've obviously tried escaping them as that's how it is currently), but to no avail.
The console output is currently.
ls: Wet: No such file or directory
ls: Picnic: No such file or directory
ls: Arizona: No such file or directory
ls: Jones: No such file or directory
-rw-r--r-- 1 root root 0 Jun 27 17:55 Bikeboy.png
SO it's clearly splitting on the space. Even though it's escaped.