1>>linux shell script编程

Studying book is <Linux Command Line and Shell Scripting Bible> by Richard Blum and Christine Bresnahan.

Thanks.

If I have enough time,I will improve this note.

Now,I‘m coding.

时间: 2024-08-06 11:56:23

1>>linux shell script编程的相关文章

Linux Shell脚本编程学习笔记和实战

http://www.1987.name/141.html shell基础 终端打印.算术运算.常用变量 Linux下搜索指定目录下特定字符串并高亮显示匹配关键词 从键盘或文件中获取标准输入 [read命令] 文件的描述符和重定向 数组.关联数组和别名使用 函数的定义.执行.传参和递归函数 条件测试操作与流程控制语句 获取时间日期格式和延时 [date.sleep命令] 内部字段分隔符IFS和脚本的调试DEBUG 显示.读取或拼接文件内容 [cat命令] 文件查找与打印文件列表 [find命令]

一个修改配置文件的linux shell script

不久以前,曾经搜到一篇博客是读取配置文件的,http://www.cnblogs.com/bo083/archive/2012/11/19/2777076.html,用到现在,感觉十分方便,感谢作者. 现在,需要通过web界面给用户留出接口来修改类似配置文件,大的方法是从php调用linux shell script,于是,现在贴一个可以修改此种配置文件的linux shell. 首先,配置文件的格式如下: [unit1] field1=value1 field2=value2 [unit2]

Linux Shell脚本编程while语句

Linux Shell脚本编程while语句案例 1,每隔3秒,打印一次系统负载 #!/bin/bash while truedo    uptime    sleep 3done 2,把监控结果保存到文件,在后台执行,然后用tail -f监控文件变化[email protected]:~/linux/shell/flow_control$ sh while.sh &[1] 12867 #!/bin/bash while truedo    uptime >> log.txt    s

Unix/Linux shell脚本编程学习--Shell Script II

Shell Script II 10.Shell echo命令 echo "OK!\n”   #显示换行 echo "It is a test" echo无拼接字符时后一般可以不使用”引号”,从上面可看出,双引号可有可无,单引号主要用在原样输出中. 显示结果重定向保存至文件: vim myfile 创建文件 echo "It is a test" > myfile cat myfile 查看文件内容 若需要原样输出字符串(不进行转义),请使用单引号.

【原】Linux shell script 2&gt;&amp;1是什么意思

先说结论, 2>&1 的意思是,把标准错误(stderr)重定向到标准输出(stdout) 如果想了解为什么,可以继续阅读: 1和2 是什么 shell中,有一些常用的文件描述符(file descriptor): 0: 标准输入(stdin) 1: 标准输出(stdout) 2: 标准错误(stderr) 所以 2>&1 中的2就是标准错误,1就是标准输出. > 符号是什么 ">" 是shell中的重定向符, 例如:echo "abc

Linux shell脚本编程基础之练习篇

shell脚本编程基础之练习篇. 1.编写一个脚本使我们在写一个脚本时自动生成”#!/bin/bash”这一行和注释信息. #!/bin/bash if [ $# -ne 1 ] then echo "请输入一个参数" exit else echo "参数正确" newfile=$1 fi #echo `grep "^#\!" ${newfile}` if ! grep "^#\!" ${newfile} &>/

linux shell script: Basic concept01 - String

basic concept01: String本文所有的测试例如无特殊说明,均based on fish shell 就从字符串说起吧,啥是字符串就不用解释了,我们来看几个简单的例子 ?> ~ set param abc ?> ~ echo "string with blank and $param surrounded with double quotation marks" string with blank and abc surrounded with double

Linux Shell脚本编程while语句案例

1,每隔3秒,打印一次系统负载 #!/bin/bash while true do uptime sleep 3 done 2,把监控结果保存到文件,在后台执行,然后用tail -f监控文件变化 [email protected]:~/linux/shell/flow_control$ sh while.sh & [1] 12867 #!/bin/bash while true do uptime >> log.txt sleep 3 done [email protected]:~/

Linux shell Script初识

shell secript: 执行方式的差异: ./ sh执行都是在创建一个子程序来执行,只会继承环境变量, 其中的变量如果export声明,子程序的子程序会继承,不会升级为环境变量 source 的执行方式是把脚本放到父程序的环境执行, 其中的变量如果export声明,会升级成环境变量 test判断,[]判断是一样的,建议使用[]的判断方式 默认变量($0, $1......) $0,$1....位置变量,代表参数 $#:代表参数的个数 [email protected]:代表参数"$1&qu