http://blog.itpub.net/27181165/viewspace-775820/ 一 IFS的介绍 Shell 脚本中有个变量叫IFS(Internal Field Seprator) ,内部域分隔符.完整定义是The shell uses the value stored in IFS, which is the space, tab, and newline characters by default, to delimit words for the read and
一 .IFS的介绍 Shell 脚本中有个变量叫IFS(Internal Field Seprator) ,内部域分隔符.完整定义是The shell uses the value stored in IFS, which is the space, tab, and newline characters by default, to delimit words for the read and set commands, when parsing output from command
在bash中IFS是内部的域分隔符,manual中对其的叙述如下:IFS The Internal Field Separator that is used for word splitting after expansion and to split lines into words with the read builtin command. The default value is “”.如下是一些值得注意的地方.1. IFS的默认值为:空白(包括:空格,tab, 和新行),将其ASSII
1. 基本概念(这是理解后面的知识的前提,请务必理解) a. I/O重定向通常与 FD有关,shell的FD通常为10个,即 0-9: b. 常用FD有3个,为0(stdin,标准输入).1(stdout,标准输出).2(stderr,标准错误输出),默认与keyboard.monitor.monitor有关: c. 用 < 来改变读进的数据信道(stdin),使之从指定的档案读进: d. 用 > 来改变送出的数据信道(stdout, stderr),使之输出到指定的档案: e. 0 是 &
Shell: 用户与操作系统之间完成交互式操作的一个接口程序,为用户提供简化了的操作:上世纪的70年代中期在贝尔实验室,Bourne位Unix开发了一个shell程序Bourne Shell,简称sh:Bill Joy:用C语言根据sh重新编写 C Shell,简称csh:躺床上为其衍生版:David Korn:集合cshhesh的优点研发的Korn Shell,简称ksh:GNU:GNU组织发现sh是比较好用的又进一步开发Borne Again Shell,简称bash:Linux系统中默认的