http://stackoverflow.com/questions/6762348/what-do-and-do-in-tcsh 写道
In tcsh redirection the ! symbol means overwrite the existing file even if noclobber is set.
In other words, if noclobber is set then:
cmd > file will write stdout to file if file does not exist
cmd > file will fail if file exists
cmd >> file will append stdout to file if file exists
cmd >> file will fail if file does not exist
cmd >! file will write stdout to file, overwriting any existing file
cmd >>! file will append stdout to file, creating the file if it does not already exist
If noclobber is not set then the ! has no effect:
cmd > file will write stdout to file, overwriting any existing file
cmd >> file will append stdout to file
cmd >! file will write stdout to file, overwriting any existing file
cmd >>! file will append stdout to file
In other words, if noclobber is set then:
cmd > file will write stdout to file if file does not exist
cmd > file will fail if file exists
cmd >> file will append stdout to file if file exists
cmd >> file will fail if file does not exist
cmd >! file will write stdout to file, overwriting any existing file
cmd >>! file will append stdout to file, creating the file if it does not already exist
If noclobber is not set then the ! has no effect:
cmd > file will write stdout to file, overwriting any existing file
cmd >> file will append stdout to file
cmd >! file will write stdout to file, overwriting any existing file
cmd >>! file will append stdout to file
相关推荐
管道命令操作符是:”|”,它仅能处理经由前面一个指令传出的正确输出信息,也就是 standard output 的信息,对于 stdandard error 信息没有直接处理能力。然后,传递给下一个命令,作为标准的输入 standard input. ...
2. 掌握shell的输入输出重定向操作符。 3. 编写shell脚本文件,并调试、执行它。 二、 实验要求 1. 要求每人能独立完成实验。能独立搭建UNIX操作系统,掌握OpenSolaris的安装、运行和使用。 2. 使用自己的账号登录...
表格 B-1. 特殊的shell变量 表格 B-2. 测试操作: 二元比较 表格 B-3....表格 B-4....表格 B-5.... sed操作符举例 . C.2. Awk .. 表格 D-1. "保留的"退出码 Appendix E. I/O和I/O 重定向的详细介绍 Shell调试 ...
模拟shell命令解释器操作系统课程设计报告 在Linux/Unix上用C语言开发一个下命令解释程序,软件能在Linux/Unix平台下运行,该程序应提供一个命令提示符:如ysh>,表示接收用户的输入,每次执行完成后再打印下一个...
o 4.2 && 和|| 操作符 * 5 case 语句 o 5.1 select 语句 o 5.2 while/for 循环 * 6 Shell里的一些特殊符号 o 6.1 引号 o 6.2 Here documents * 7 Shell里的函数 * 8 命令行参数 * 9 Shell脚本...
第7章 退出、测试、判断及操作符 157 第8章 循环与结构化命令 187 第9章 变量的高级用法 217 第10章 I/O重定向 243 第11章 Linux/UNIX Shell类型与区别 273 第12章 子Shell与进程处理 288 第13章 函数 314 第...
因此之前介绍的《shell编程范例之字符串操作》在这里将会得到广泛的应用,关于普通文件的读写操作我想我们已经用得非常熟练啦,那就是“重定向”,在这里,我们会把这部分独立出来介绍。关于文件在Linux下的“数字化”...
shell 或者命令行解释器是操作系统中最基本的用户接口。写一个简单的shell 程序——myshell,它具有以下属性: (一) 这个shell 程序必须支持以下内部命令:bg、cd 、clr、dir、echo 、exec 、exit 、environ、fg 、...
重定向操作符创建了一个文件test6(通过默认的umask设置),并将date命令的输出重定向 到该文件中。如果输出文件已经存在了,重定向操作符会用新的文件数据覆盖已有文件。 不想覆盖文件原有内容,而是想要将命令的...
项目九 Shell输入/输出重定向 158 [学习目标] 158 任务9.1 linux文件描述符 159 任务9.2 Shell输入/输出重定向 160 9.2.1 输出重定向 160 9.2.2 输入重定向 163 9.2.3 重定向深入讲解 164 任务9.2 Shell案例:通过...
17.2 测试时使用逻辑操作符 155 17.3 字符串测试 155 17.4 测试数值 156 17.5 expr用法 157 17.5.1 增量计数 158 17.5.2 数值测试 158 17.5.3 模式匹配 158 17.6 小结 159 第18章 控制流结构 160 18.1 退出状态 160 ...
1.1 Shell提示符 6 1.2 文件与目录Shell命令 7 1.2.1 更改目录命令(cd) 7 1.2.2 列表命令(ls) 7 1.2.3 操作文件命令 10 1.2.4 目录处理命令 14 1.2.5 查看文件内容命令 15 1.3 监控程序 20 1.3.1 进程查看 20 1.3.2 ...
o 4.2 && 和|| 操作符 • 5 case 语句 o 5.1 select 语句 o 5.2 while/for 循环 • 6 Shell里的一些特殊符号 o 6.1 引号 o 6.2 Here documents • 7 Shell里的函数 • 8 命令行参数 • 9 Shell脚本示例 o ...
包括概述、linux文件系统、正则表达式、sed命令和awk编程、文件的排序、合并和分割、变量和引用、操作符、循环与结构化命令、变量的该机用法、I/O重定向、linux/unix shell类型与区别、子shell进程处理、函数、别名...
编写一个C语言程序作为Linux内核的shell命令行解释程序,所执行的结果需和系统命令行方式保持一致。 增加后台运行功能。即用户可以使用”&”作为一个命令结束,以启动下一个命令。 增加I/O重定向功能。即用户可以...
7.2. 文件测试操作符 7.3. 其他比较操作符 7.4. 嵌套的if/then条件测试 7.5. 检测你对测试知识的掌握情况 8. 操作符与相关主题 8.1. 操作符 8.2. 数字常量 第三部分. 进阶 9. 变量重游 9.1. 内部变量 9.2. 操作字符...
17.2 测试时使用逻辑操作符 155 17.3 字符串测试 155 17.4 测试数值 156 17.5 expr用法 157 17.5.1 增量计数 158 17.5.2 数值测试 158 17.5.3 模式匹配 158 17.6 小结 159 第18章 控制流结构 160 18.1 退出状态 160 ...
9.4 从shell中访问描述符 第10章 管道输入读 10.1 逐行选项1 10.2 逐行选项2 10.3 逐行选项3 10.4 逐行选项4 10.5 直接管道读 10.6 逐字处理输入 第2部分 系统交互与高级技术 第11章 shell中的数学 11.1 expr 11.2 ...
Linux操作系统中shell是用户与系统内核沟通的中介,它为用户使用操作系统的服务提供了一个命令界面。用户在shell提示符($或#)下输入的每一个命令都由shell先解释,然后传给内核执行。本实验要求用C语言编写一个简单...
17.2 测试时使用逻辑操作符 155 17.3 字符串测试 155 17.4 测试数值 156 17.5 expr用法 157 17.5.1 增量计数 158 17.5.2 数值测试 158 17.5.3 模式匹配 158 17.6 小结 159 第18章 控制流结构 160 18.1 退出状态 160 ...