From owner-freebsd-hackers@FreeBSD.ORG Sun May 25 15:46:02 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 627521065681 for ; Sun, 25 May 2008 15:46:02 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep20-int.chello.at (viefep20-int.chello.at [62.179.121.40]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB038FC17 for ; Sun, 25 May 2008 15:46:00 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from lizard.fafoe.narf.at ([213.47.85.26]) by viefep20-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20080525154559.MHIW17529.viefep20-int.chello.at@lizard.fafoe.narf.at>; Sun, 25 May 2008 17:45:59 +0200 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 7A666BE00; Sun, 25 May 2008 17:45:37 +0200 (CEST) Date: Sun, 25 May 2008 17:45:37 +0200 From: Stefan Farfeleder To: John E Hein Message-ID: <20080525154537.GB1026@lizard.fafoe.narf.at> Mail-Followup-To: John E Hein , Mike Meyer , hackers@freebsd.org References: <20080309152712.42752293@bhuda.mired.org> <20080516074433.GA1032@lizard.fafoe.narf.at> <20080516101143.3545937c@bhuda.mired.org> <20080516141307.GB1032@lizard.fafoe.narf.at> <18489.32903.477434.465037@gromit.timing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18489.32903.477434.465037@gromit.timing.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: hackers@freebsd.org, Mike Meyer Subject: Re: Why doesn't autoconf like our /bin/sh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2008 15:46:02 -0000 On Sun, May 25, 2008 at 09:06:47AM -0600, John E Hein wrote: > FWIW, it seems bash and sh report line number differently. > > # grep -n ^ ~/tmp/ln > 1:#!/bin/sh > 2:echo f line: $LINENO > 3:f() > 4:{ > 5:echo f line: $LINENO > 6:} > 7: > 8:f > 9:echo main line: $LINENO > 10:f > > > # /bin/sh ~/tmp/ln > f line: 2 > f line: 3 > main line: 9 > f line: 3 > > > # bash ~/tmp/ln > f line: 2 > f line: 5 > main line: 9 > f line: 5 Yes, I know. I think it is a bug in bash as SUSv3 states: "Set by the shell to a decimal number representing the current sequential line number (numbered starting with 1) within a script or function before it executes each command." Stefan