1、安装linux二维码生成软
a) qrencode-3.4.4.tar.bz2
# tar -xvjf qrencode-3.4.4.tar.bz2
# cd qrencode-3.4.4
#./configure
#make
#make install
b) 依赖的包(zlib-1.2.5.1.tar.gz/libpng-1.2.52.tar.gz)
#tar -zxvf zlib-1.2.5.1.tar.gz
#cd zlib-1.2.5.1
#./configure -libdir=/usr/lib -includedir=/usr/include
#make
#make install
---------------------------------------------------------------------
#tar -zxvf libpng-1.2.52.tar.gz
#cd libpng-1.2.52.tar.gz
#./configure -libdir=/usr/lib -includedir=/usr/include
#make
#make install
c) 测试:#qrencode -o /test.png “Hello,Linux”
2、编写shell脚本
#!bin/sh
cat /user/info.txt|while read line; do
info=`awk 'BEGIN {split("'"$line"'",arr);print arr[1]}'`
qrcodesh=`qrencode -o /user/haha.png $info`
echo $qrcodesh
done
评论