Skip to content

Instantly share code, notes, and snippets.

@ziggear
Created March 11, 2014 05:13
Show Gist options
  • Save ziggear/9479865 to your computer and use it in GitHub Desktop.
Save ziggear/9479865 to your computer and use it in GitHub Desktop.
姓名列表操作 bash
#!/bin/bash
#
# 1:列出文件夹下所有人的名字并保存成文件
# 2:根据指定URL到Google生成QRCode并下载
#
rm ./name_list.txt
rm -r ./QRCodes
mkdir ./QRCodes
i=0
for name in *.jpg;
do
url="http://www.xxx.com/people/"$i
echo $i "${name%.*}" $url >> name_list.txt
curl "https://chart.googleapis.com/chart?cht=qr&chs=300x300&choe=UTF-8&chld=L%7C4&chl="$url -o ./QRCodes/"${name%.*}.png"
let i++;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment