
Linux Shell
文章平均质量分 80
zhangjun_44
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于shell 函数得返回值得取得
转至:http://blog.youkuaiyun.com/zg_hover/archive/2006/12/05/1430978.aspx从chinaunix上看到了关于shell函数返回值得一些贴子,现在把这些总结一下:(1)从shell函数中得到一个返回状态(整数)例子:#!/bin/sha(){ return 1}#运行函数a#取得返回值ok=$?echo $ok这样得到得函数的返回值ok就是1(2)返回字符窜的例子#!/bin/shb(){ echo "this is a test"; #cm转载 2010-08-06 14:11:00 · 1226 阅读 · 0 评论 -
shell学习之-特殊字符
<br />转自:http://blog.youkuaiyun.com/zg_hover/archive/2007/10/29/1854011.aspx<br /> shell中的特殊字符<br />;<br />分隔符号,用来表示一行执行多条命令<br /> echo hello; echo there<br /> if [ -f "$file" ]; then<br /> cd "$file"<br /> fi<br />;;<转载 2010-08-06 15:17:00 · 602 阅读 · 0 评论 -
shell学习之-程序的流程控制
转自:http://blog.youkuaiyun.com/zg_hover/archive/2007/10/15/1826001.aspxshell编程学习 2 3 1, shell程序的流程控制 4 5 **条件测试语句if then fi 6 全部的基本形式为: 7 8 if xxxx; then 9 xxx 10 elif xxx; then 11 xxx 12 elsif xxx; then 13 xxx 14 else 15 xxx 16转载 2010-08-06 14:58:00 · 721 阅读 · 0 评论 -
shell学习之合并与分割
<br />转自:http://blog.youkuaiyun.com/zg_hover/archive/2008/04/09/2270932.aspx<br />shell学习之合并与分割<br />1,sort用法<br /> sort 在执行时先查看是否为域分隔设置了-t选项,如果设置了,则使用它来将记录分成域0、域1等等。如果没有设置,用空格代替。缺省时sort将整个行排序,指定域的情况例外。例如:<br /> 注意:域是从0开始的<br /> field0 field1 fiel转载 2010-08-06 15:28:00 · 558 阅读 · 0 评论