标签:
[root@mylab demo]# echo $var
939f61b61978a589d9873e9ea7fdf201b213dec2
[root@mylab demo]# echo ${var:0:5}
939f6
[root@mylab demo]# git show |grep commit|cut -d ‘ ‘ -f 2|cut -c1-10
939f61b619
[root@mylab demo]# awk ‘BEGIN{print substr("‘${var}‘",1,10)}‘
939f61b619
标签:
原文地址:http://www.cnblogs.com/liujianzuo888/p/4988714.html