[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossig] help on shell scripts



i was working on a bash script to resize photo in a
directory(because my friend have pictures with a total
of  >100MB). and i happen to have imagemagick on my
linux system. 

the requirement is that, it is able to process every
file in the family. and exclude non-graphic file

the point, 
how do i pass directory as an argument in bash? 
how do i exclude other file type except picture?

this is what already finish work on:

#begin of script
#!/bin/bash

for img in $1
do
  mv $img copy-$img
  convert -sample 75%x75% copy-$img $img
  rm copy-$img
done
exit 0
#end of script


		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

---------------------------------------------------------
To unsubscribe: send mail to ossig-request@mncc.com.my
with "unsubscribe ossig" in the body of the message