I\'m trying to write script that\'ll crop and resize large photos into HD Wallpapers.
#! /bin/bash
for i in `ls *.jpg`
do
width=`identify -format \'%w
I would recommend to write the for-line like this:
for i in *.jpg
and encapsulate $i in double-quotes: "$i".
If you insist on the
`ls *.jpg`
style, (if you for instance get your file-names from a more complex command) you could try setting IFS to \n:
IFS='\n'
Compare these two executions:
$ for f in `ls *`; do echo $f; done
hello
world
test
$ IFS='\n'; for f in `ls *`; do echo $f; done
hello world
test