I'm using this line to batch my pngcrush
, yet my files contain spaces, which get's placed literally into $line
, making them get skipped as they aren't valid paths:
ls *.png | while read line; do pngcrush -brute $line compressed/$line; done
How can I make $line become escape like this filename Button - Users.png
would be replaced with Button\ -\ Users.png
?
Don't parse the output of
ls
. Use afor
loop here instead.