shell
文章平均质量分 79
znapast
这个作者很懒,什么都没留下…
展开
-
grep 与正则表达式
1基础正则表达式 grep 工具,以前介绍过。 grep -[acinv] '搜索内容串' filename -a 以文本文件方式搜索 -c 计算找到的符合行的次数 -i 忽略大小写 -n 顺便输出行号 -v 反向选择,即找 没有搜索字符串的行 其中搜索串可以是正则表达式! 1 搜索有the的行,并输出行号 $grep -n 'the' regula转载 2013-10-31 11:19:43 · 484 阅读 · 0 评论 -
linux 添加静态路由
linux下静态路由修改命令方法一:添加路由route add -net 192.168.0.0/24 gw 192.168.0.1route add -host 192.168.1.1 dev 192.168.0.1删除路由route del -net 192.168.0.0/24 gw 192.168.0.1add 增加路由del 删除路由-net 设置转载 2013-12-10 15:29:23 · 280 阅读 · 0 评论 -
shell中的条件判断、参数以及变量替换
一、test命令 test命令是shell内部命令,它计算作为其参数的表达式是真还是假。 如果表达式为真,则test返回0(注意与C语言0表示false不同),如果表达式为假,返回非0。 shell提供了另外一个调用test命令的方式,就是用方括号[]来代替单词test。 调用test命令的格式为: test expr1 opr expr2 或是 [ expr1转载 2013-12-11 11:19:10 · 572 阅读 · 0 评论 -
linux shell bash 内置变量参考
特殊的shell变量变 量含义$0脚 本名字$1位置参数 #1$2 - $9位置参数 #2 - #9${10}位置参数 #10$#位置参数的个数"$*"所有的位置参数(作为单个字符串) *"$@"所有的位置参数(每个都作为独立的字符串)${转载 2013-12-11 11:25:26 · 537 阅读 · 0 评论 -
shell for 循环
关于shell中的for循环用法很多,一直想总结一下,今天网上看到上一篇关于for循环用法的总结,感觉很全面,所以就转过来研究研究,嘿嘿...1、 for((i=1;i2、在shell中常用的是 for i in $(seq 10)3、for i in `ls`4、for i in ${arr[@]}5、for i in $* ; do6、for File in /转载 2013-12-14 11:38:11 · 365 阅读 · 0 评论 -
shell 命令行选项、参数处理
写程序的时候经常要处理命令行参数,本文描述在Bash下的命令行处理方式。 选项与参数: 如下一个命令行: ./test.sh -f config.conf -v --prefix=/home 我们称-f为选项,它需要一个参数,即config.conf, -v 也是一个选项,但它不需要参数。 --prefix我们称之为一个长选项,即选项本身多于转载 2013-12-14 11:07:54 · 613 阅读 · 0 评论 -
shell 中输出带颜色的文字
shell脚本中echo显示内容带颜色显示,echo显示带颜色,需要使用参数-e 格式如下: echo -e "\033[字背景颜色;文字颜色m字符串\033[0m" 例如: echo -e "\033[41;36m something here \033[0m" 其中41的位置代表底色, 36的位置是代表字的颜色 注: 1、字背景颜色和文字转载 2013-12-17 09:22:46 · 317 阅读 · 0 评论 -
Android 编译系统常用命令
- croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm: Builds all of the modules in the current directory. - mmm: Builds all of the mod转载 2014-09-19 09:16:44 · 407 阅读 · 0 评论