linux截取指定字符shell cut awk
2015-11-23 15:59
411 查看
[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
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
相关文章推荐
- 使用C编写shellcode
- make -C $(KDIR) M=$(shellpwd) modules
- shell中经常能看到的:>/dev/null 2>&1
- SSH Secure Shell Client中文乱码的解决方法
- shell 学习笔记
- shell 学习笔记
- Linux下创建shell命令集合——你意想不到的软连接
- 找个大牛拿shell,网站权限,数据,重酬
- linux中shell截取字符串方法总结
- C语言system()函数:执行shell命令
- Python调用shell
- Shell编程实例
- linux shell date 时间运算以及时间差计算方法
- fastq to tasta using linux shell script
- 远程登录linux服务器后在.bashrc上的一些环境变量的设置
- 基于行为分析来发现"未知的Webshell"
- shellapi
- shell awk
- git bash SSH
- shell中输出带颜色的字体