xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/rstest4.awk (revision 8459c777fc1aaabb2f7dad05de1313aa169417cd)
1# From spcecdt@armory.com  Mon May  5 14:37:09 2003
2# Return-Path: <spcecdt@armory.com>
3# Received: from localhost (skeeve [127.0.0.1])
4# 	by skeeve.com (8.12.5/8.12.5) with ESMTP id h45B1GvT031993
5# 	for <arnold@localhost>; Mon, 5 May 2003 14:37:09 +0300
6# Received: from actcom.co.il [192.114.47.1]
7# 	by localhost with POP3 (fetchmail-5.9.0)
8# 	for arnold@localhost (single-drop); Mon, 05 May 2003 14:37:09 +0300 (IDT)
9# Received: by actcom.co.il (mbox arobbins)
10#  (with Cubic Circle's cucipop (v1.31 1998/05/13) Mon May  5 14:35:11 2003)
11# X-From_: spcecdt@armory.com Mon May  5 12:20:20 2003
12# Received: from smtp1.actcom.net.il by actcom.co.il  with ESMTP
13# 	(8.11.6/actcom-0.2) id h459KC529186 for <arobbins@actcom.co.il>;
14# 	Mon, 5 May 2003 12:20:15 +0300 (EET DST)
15# 	(rfc931-sender: smtp.actcom.co.il [192.114.47.13])
16# Received: from f7.net (consort.superb.net [209.61.216.22])
17# 	by smtp1.actcom.net.il (8.12.8/8.12.8) with ESMTP id h459LMfl025854
18# 	for <arobbins@actcom.co.il>; Mon, 5 May 2003 12:21:24 +0300
19# Received: from armory.com (deepthought.armory.com [192.122.209.42])
20# 	by f7.net (8.11.7/8.11.6) with SMTP id h459K9I26841
21# 	for <arnold@skeeve.com>; Mon, 5 May 2003 05:20:09 -0400
22# Date: Mon, 5 May 2003 02:20:08 -0700
23# From: "John H. DuBois III" <spcecdt@armory.com>
24# To: Aharon Robbins <arnold@skeeve.com>
25# Subject: Re: gawk 3.1.2b now available
26# Message-ID: <20030505092008.GA15970@armory.com>
27# References: <200305041149.h44BnLcm005484@localhost.localdomain>
28# Mime-Version: 1.0
29# Content-Type: text/plain; charset=us-ascii
30# Content-Disposition: inline
31# In-Reply-To: <200305041149.h44BnLcm005484@localhost.localdomain>
32# User-Agent: Mutt/1.3.28i
33# X-Www: http://www.armory.com./~spcecdt/
34# Sender: spcecdt@armory.com
35# X-SpamBouncer: 1.4 (10/07/01)
36# X-SBClass: OK
37# Status: RO
38#
39# This is a curious one:
40#
41# gawk-3.1.2b 'BEGIN {
42#     while (("echo" | getline) == 1)
43# 	;
44#     RS = ""
45#     "echo \"a\n\nb\"" | getline y
46#     print x
47# }' | hd
48#
49# The output is:
50#
51# 0000    00 13 0a                                           ...
52# 0003
53#
54# (the uninitialized variable 'x' is somehow getting the value <null><control-S>)
55#
56# 	John
57# --
58# John DuBois  spcecdt@armory.com  KC6QKZ/AE  http://www.armory.com/~spcecdt/
59#
60BEGIN {
61    while (("echo" | getline) == 1)
62	;
63    RS = ""
64    "echo \"a\n\nb\"" | getline y
65    printf "y = <%s>\n", y	# ADR
66    printf "x = <%s>\n", x	# ADR
67}
68