Date: Sun, 25 May 2008 09:58:34 -0600 From: John E Hein <jhein@timing.com> To: Stefan Farfeleder <stefan@fafoe.narf.at> Cc: hackers@freebsd.org, Mike Meyer <mwm@mired.org> Subject: Re: Why doesn't autoconf like our /bin/sh? Message-ID: <18489.36010.220739.891583@gromit.timing.com> In-Reply-To: <20080525154537.GB1026@lizard.fafoe.narf.at> 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> <20080525154537.GB1026@lizard.fafoe.narf.at>
next in thread | previous in thread | raw e-mail | index | archive | help
Stefan Farfeleder wrote at 17:45 +0200 on May 25, 2008: > 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." Okay. Not knowing more context, I guess the 'or' (script or function) leaves things somewhat subject to interpretation.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18489.36010.220739.891583>