From owner-freebsd-hackers@FreeBSD.ORG Sat May 31 10:26:58 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED35D106567B; Sat, 31 May 2008 10:26:58 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep34-int.chello.at (viefep18-int.chello.at [213.46.255.22]) by mx1.freebsd.org (Postfix) with ESMTP id 05AC68FC36; Sat, 31 May 2008 10:26:57 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from lizard.fafoe.narf.at ([213.47.85.26]) by viefep32-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20080531101135.JEDI25835.viefep32-int.chello.at@lizard.fafoe.narf.at>; Sat, 31 May 2008 12:11:35 +0200 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 2BB88BAEC; Sat, 31 May 2008 12:11:01 +0200 (CEST) Date: Sat, 31 May 2008 12:11:01 +0200 From: Stefan Farfeleder To: John Baldwin Message-ID: <20080531101101.GA1077@lizard.fafoe.narf.at> Mail-Followup-To: John Baldwin , freebsd-hackers@freebsd.org, hackers@freebsd.org, Mike Meyer , John E Hein References: <20080309152712.42752293@bhuda.mired.org> <18489.32903.477434.465037@gromit.timing.com> <20080525154537.GB1026@lizard.fafoe.narf.at> <200805290004.41653.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805290004.41653.jhb@freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org, Mike Meyer , John E Hein 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: Sat, 31 May 2008 10:26:59 -0000 On Thu, May 29, 2008 at 12:04:41AM -0400, John Baldwin wrote: > On Sunday 25 May 2008 11:45:37 am Stefan Farfeleder wrote: > > 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." > > Actually, the bash way seems more intuitive. And it does say "the current > sequentional line number within a ... function before it executes each > command" > > The "within a function" implies that this property goes inside of functions > instead of forcing all commands in a function to use the starting line of the > function which is what you are saying? I've started a thread about that on standards@.