shell命令一些技巧
2016-01-07 09:28
495 查看
一、字符串截取
http://www.jb51.net/article/47529.htm
二、判断一个字符串是否包含另一个字符串
str='this is a tree! and that is a car.'
//如果包含this
[[ $str =~ "this" ]] && echo "\$str contains this"
//如果不包含that
[[ $str =~ "that" ]] || echo "\$str does NOT contain that"
http://www.jb51.net/article/47529.htm
二、判断一个字符串是否包含另一个字符串
str='this is a tree! and that is a car.'
//如果包含this
[[ $str =~ "this" ]] && echo "\$str contains this"
//如果不包含that
[[ $str =~ "that" ]] || echo "\$str does NOT contain that"
相关文章推荐
- Bash shell编程<五>:while命令、until命令
- 那些年我们一起做过的shell面试题(一)
- shell命令之sed
- xshell 技巧
- 解决ssh远程连接错误问题
- 熟练掌握HDFS的Shell访问
- inux 下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件的作用
- 一句话木马上传常见的几种方法
- (2-1)HDFS( 分布式文件系统和hdfs shell)
- chapte13:学习shell scripts之(4)循环
- 16.shell脚本编程(1)
- 字符展开详解
- nohup-真正的Shell后台运行
- 一个ShellExecute的超全说明(www.phidels.com这个网站很多内容)
- 【2-1】HDFS简介与HDFS Shell
- shell三剑客之一AWK的使用
- 如何用shell脚本编译java工程
- 如何用shell脚本编译java工程
- Linux下shell的学习--之杂七杂八
- Xshell无法连接VMware中的Linux Mint解决方法