From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: Charles Forsyth To: 9fans@cse.psu.edu Subject: Re: [9fans] is there any good reason why awk does this? In-Reply-To: <1ef339d30bfee33810aa4e1d0c4488af@sdgm.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-qxrxqtovldrnartipcitophyzd" Date: Mon, 1 Sep 2003 08:01:52 +0100 Topicbox-Message-UUID: 26e6fdd4-eacc-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-qxrxqtovldrnartipcitophyzd Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit same reason as this, i suspect: awk 'END {print 1 * "hello"}' /dev/null 0 the rules aren't really given in the manual page except perhaps by implication in the BUGS, but in a context where a number is expected (operand of arithmetic operator) the string is converted to a number, and "hello" or "foo" are both zero, but "5hello" is 5. exit takes an expression but doesn't say whether it's integer or string (but it's integer, as usual on Unix). --upas-qxrxqtovldrnartipcitophyzd Content-Type: message/rfc822 Content-Disposition: inline Return-path: <9fans-admin@cse.psu.edu> Received: from punt-3.mail.demon.net by mailstore for forsyth@caldo.demon.co.uk id 19tems-0004U3-4d; Mon, 01 Sep 2003 02:51:26 +0000 Received: from [130.203.4.6] (helo=mail.cse.psu.edu) by punt-3.mail.demon.net with esmtp id 19tems-0004U3-4d for forsyth@caldo.demon.co.uk; Mon, 01 Sep 2003 02:51:26 +0000 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 7D14F19A87; Sun, 31 Aug 2003 22:51:13 -0400 (EDT) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.30.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id E193519A87; Sun, 31 Aug 2003 22:51:08 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 34D6719A97; Sun, 31 Aug 2003 22:50:37 -0400 (EDT) Received: from brahma.sdgm.net (brahma.sdgm.net [64.32.179.49]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 9B9BD19A87 for <9fans@cse.psu.edu>; Sun, 31 Aug 2003 22:50:35 -0400 (EDT) Message-ID: <1ef339d30bfee33810aa4e1d0c4488af@sdgm.net> From: boyd@sdgm.net To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] is there any good reason why awk does this? Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Sun, 31 Aug 2003 22:50:34 -0400 X-Spam-Status: No, hits=1.4 required=5.0 tests=NO_REAL_NAME,RCVD_IN_OSIRUSOFT_COM version=2.55 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) brahma% awk 'END {exit "foo"}' /dev/null ; echo $status brahma% awk 'END {exit 1}' /dev/null ; echo $status awk 8186: 1 --upas-qxrxqtovldrnartipcitophyzd--