关于one-true-awk和gawk对RS处理的差异的源代码…
2009-05-13 05:04:38来源:未知 阅读 ()
http://bbs.chinaunix.net/viewthread.php?tid=846353&extra=page%3D1&page=1
FreeBSD的awk是传统的awk,见代码中的版权声明:
CODE:
[Copy to clipboard]
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name Lucent Technologies or any of
its entities not be used in advertising or publicity pertaining
to distribution of the software without specific, written prior
permission.
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/以及README文件中的片段:
QUOTE:
This is the version of awk described in "The AWK Programming Language",
by Al Aho, Brian Kernighan, and Peter Weinberger
(Addison-Wesley, 1988, ISBN 0-201-07981-X).而gawk则对此进行了扩展,见【GAWK: Effective AWK Programming】:
QUOTE:
When using gawk, the value of RS is not limited to a one-character string. It can be any regular expression.
The use of RS as a regular expression and the RT variable are gawk extensions; they are
not available in compatibility mode. In compatibility mode, only the first character of the value of RS is used to determine the end of the record.对这种差异的源代码定位如下:
FreeBSD6.1
/usr/src/contrib/one-true-awk/lib.c:
CODE:
[Copy to clipboard]
int readrec(char **pbuf, int *pbufsize, FILE *inf) /* read one record into buf */
{
int sep, c;
char *rr, *buf = *pbuf;
int bufsize = *pbufsize;
if (strlen(*FS) >= sizeof(inputFS))
FATAL("field separator %.10s... is too long", *FS);
strcpy(inputFS, *FS); /* for subsequent field splitting */
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:js注册检测
- 分析squid的日志,罗列出一天最多的点击url 2009-05-13
- 分析工作迁移到 NetBSD 5.0 2009-05-13
- FreeBSD下authlib出现Input/output error的分析及解决一例 2009-05-13
- 转载文章-- Windows下不安装FreeBSD轻松得到FreeBSD内核源代 2009-05-13
- 系统上电时的启动代码分析 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash