ImageMagic:
1.convert -resize 520x460 /photo/1.JPG /photo/result/6.jpg
做.sh文件
chmod +x filename 这样才能用./filename 来运行
dos2unix imageMagicToSmall.sh
执行压缩:
./imageMagicToSmall.sh /photo/3.gif /photo/result/3.gif
/
imageMagicToSmall.sh:
if ( test "$2" ) then
echo "two args"
echo "$1"
echo "$2"
date
convert -resize 520x460 "$1" "$2"
date
else
echo "no arg"
fi
/
/
ImageMagick安装起来也相当方便,ImageMagick的包,,打包下载后运行:
tar zxvf imagemagick.tar.gz
cd ImageMagick-xx-xx
./configure --prefix=/usr/local/ImageMagick
make && make install
export PATH=$PATH:/usr/local/ImageMagick/bin
/
/
#!/bin/sh
startTime=`date "+%Y-%m-%d %H:%M:%S"`
echo "start time is $startTime"
notice: startTime于等号(=)不能有空格的 ,后面也一样的
/