This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
正则匹配 | |
匹配中文字符的正则表达式: [\u4e00-\u9fa5] | |
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了 | |
匹配双字节字符(包括汉字在内):[^\x00-\xff] | |
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1) | |
匹配空白行的正则表达式:\n\s*\r | |
评注:可以用来删除空白行 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEY=XXXXXXXXXXXX | |
HOST="https://metrics.crisidev.org" | |
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do | |
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json | |
done |