2018-12-11更新
-
cat命令赋值变量后不换行
cat命令在命令行状态下会自动换行
AppledeMacBook-Pro-2:~ WYC$ cat /Users/WYC/Downloads/test.log
0b61329d ip校验
6f10d9f3 Merge branch 'develop2.0' of http://192.168.200.71/weex/diibeeapp_weex into develop2.0
ba4a49e8 调整首页轮播图高度
8ab8c52b config修改
11709639 版本号bug fix
d7fb9b91 关于读取modual
a53cd88f 弹出确认框的时候 不接受同步请求
79c889ee Merge branch 'develop2.0' of http://192.168.200.71/weex/diibeeapp_weex into develop2.0
fb8420b9 修复token过期,重置失败的问题
57b01d0a iphonex适配
但是我发现在赋值给变量后
filepath=xxxxx
email_result=$(cat ${filepath})
echo -e $email_result
输出不会换行。
后来搜索一番发现了解决办法
filepath=xxxxx
email_result=$(cat ${filepath})
echo -e "$email_result"
没错加个引号就好了。
我最终使用的代码,
filepath=xxxxx
email_result=$(cat ${filepath})
email_content="下载地址:xxxx"'\n'"更新日志:"'\n'"$email_result"
sendEmail -f ${email_sender} -t ${email_reciver} -s ${email_smtphost} -u ${email_title} -xu ${email_username} -xp ${email_password} -m "$email_content" -a ${file_path} -o message-charset=utf-8
-
shell脚本解析Plist
mac下解析工具是PlistBuddy
使用方法
//读取build号
/usr/libexec/PlistBuddy -c "Print CFBundleVersion" /Users/ypf/Desktop/iOS.plist
//读取version号
/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" /Users/ypf/Desktop/iOS.plist
网友评论