From owner-freebsd-standards@FreeBSD.ORG Mon May 26 11:06:56 2008 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B2781065678 for ; Mon, 26 May 2008 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 766248FC2E for ; Mon, 26 May 2008 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4QB6uO0065056 for ; Mon, 26 May 2008 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4QB6tuT065052 for freebsd-standards@FreeBSD.org; Mon, 26 May 2008 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 26 May 2008 11:06:55 GMT Message-Id: <200805261106.m4QB6tuT065052@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 11:06:56 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards sh(1) null char in quoted string o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY 4 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s bin/14925 standards getsubopt isn't poisonous enough o stand/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards ln(1) Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec f stand/25777 standards [kernel] [patch] atime not updated on exec a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h o kern/27835 standards [libc] execve() doesn't conform to execve(2) spec in s s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards [libc] [patch] _gettemp uses a far smaller set of file o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards [feature request] [atch] regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm a stand/86484 standards [PATCH] mkfifo(1) uses wrong permissions o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards [headers] clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] make(1): Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards [headers] [patch] Wrong values for _POSIX_ minimal lim o stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o kern/114578 standards [libc] wide character printing using swprintf(dst, n, o stand/116081 standards make does not work with the directive sinclude o stand/116221 standards [kernel] [patch] [request] SUS issue -- FreeBSD has no o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116826 standards [PATCH] sh support for POSIX character classes o stand/118047 standards SUGGESTION: /etc/printcap vs mergemaster o stand/119804 standards [timedef] [patch] Invalid (long)date format in pl_PL.I o stand/120947 standards xsm ignores system.xsm and .xsmstartup o stand/121568 standards [patch] ln(1): wrong "ln -s" behaviour o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/122051 standards Add posix_spawn(3) o stand/123688 standards POSIX standard changes in unistd.h and grp.h 50 problems total. From owner-freebsd-standards@FreeBSD.ORG Thu May 29 13:30:07 2008 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188F7106564A for ; Thu, 29 May 2008 13:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CF44E8FC26 for ; Thu, 29 May 2008 13:30:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4TDU6ZF011803 for ; Thu, 29 May 2008 13:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4TDU64j011800; Thu, 29 May 2008 13:30:06 GMT (envelope-from gnats) Date: Thu, 29 May 2008 13:30:06 GMT Message-Id: <200805291330.m4TDU64j011800@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Gavin Atkinson Cc: Subject: Re: standards/55112: glob.h, glob_t's gl_pathc should be "size_t", not "int". X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gavin Atkinson List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2008 13:30:07 -0000 The following reply was made to PR standards/55112; it has been noted by GNATS. From: Gavin Atkinson To: bug-followup@FreeBSD.org Cc: Subject: Re: standards/55112: glob.h, glob_t's gl_pathc should be "size_t", not "int". Date: Thu, 29 May 2008 14:21:48 +0100 This is fixed in -HEAD and RELENG_7, but from the sound of it may not be MFCable to RELENG_6 due to ABI changes. Can anyone confirm that this is the case, and if so, close it? From owner-freebsd-standards@FreeBSD.ORG Fri May 30 17:44:33 2008 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E2F1065672 for ; Fri, 30 May 2008 17:44:33 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep33-int.chello.at (viefep18-int.chello.at [213.46.255.22]) by mx1.freebsd.org (Postfix) with ESMTP id EF6918FC21 for ; Fri, 30 May 2008 17:44:32 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from lizard.fafoe.narf.at ([213.47.85.26]) by viefep11-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20080530172742.VXUA7426.viefep11-int.chello.at@lizard.fafoe.narf.at> for ; Fri, 30 May 2008 19:27:42 +0200 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id F1055BAD1; Fri, 30 May 2008 19:27:12 +0200 (CEST) Date: Fri, 30 May 2008 19:27:12 +0200 From: Stefan Farfeleder To: freebsd-standards@freebsd.org Message-ID: <20080530172711.GA1056@lizard.fafoe.narf.at> Mail-Followup-To: freebsd-standards@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Subject: $LINENO within functions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 17:44:33 -0000 Hi, SUSv3 says the following about $LINENO: "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. If the user unsets or resets LINENO , the variable may lose its special meaning for the life of the shell. If the shell is not currently executing a script or function, the value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 specifies the effects of the variable only for systems supporting the User Portability Utilities option." My initial interpretation of "or function" was that it means $LINENO within a function should be relative to the function's beginning line. Now I'm not so sure anymore. Bash release 2.05b changed the expansion of $LINENO within functions to absolute numbering, stating this is required by POSIX. But then I wonder about the meaning of "or function". Does it mean functions in interactive scripts? Because for functions in shell scripts the mentioning of both "script" and "function" seems redundant. Stefan From owner-freebsd-standards@FreeBSD.ORG Fri May 30 18:21:39 2008 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 059461065678 for ; Fri, 30 May 2008 18:21:39 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 897548FC17 for ; Fri, 30 May 2008 18:21:38 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m4UILZug021980; Fri, 30 May 2008 20:21:35 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m4UILYq5021979; Fri, 30 May 2008 20:21:34 +0200 (CEST) (envelope-from olli) Date: Fri, 30 May 2008 20:21:34 +0200 (CEST) Message-Id: <200805301821.m4UILYq5021979@lurza.secnetix.de> From: Oliver Fromme To: freebsd-standards@FreeBSD.ORG, stefan@fafoe.narf.at In-Reply-To: <20080530172711.GA1056@lizard.fafoe.narf.at> X-Newsgroups: list.freebsd-standards User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 30 May 2008 20:21:35 +0200 (CEST) Cc: Subject: Re: $LINENO within functions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-standards@FreeBSD.ORG, stefan@fafoe.narf.at List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 18:21:39 -0000 Stefan Farfeleder wrote: > SUSv3 says the following about $LINENO: > > "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. If the user unsets or resets > LINENO , the variable may lose its special meaning for the life of the > shell. If the shell is not currently executing a script or function, the > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > specifies the effects of the variable only for systems supporting the > User Portability Utilities option." > > My initial interpretation of "or function" was that it means $LINENO > within a function should be relative to the function's beginning line. > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > of $LINENO within functions to absolute numbering, stating this is > required by POSIX. But then I wonder about the meaning of "or > function". Does it mean functions in interactive scripts? Because for > functions in shell scripts the mentioning of both "script" and > "function" seems redundant. When reading the SUSv3 text, my interpretation is the same as your initial interpretation. FWIW, Solaris' POSIX shell (ksh) behaves like FreeBSD's sh, not like bash. Same for zsh. So bash seems to be pretty much alone in its inter- pretation of SUSv3. I also think that it should not make a difference whether a function definition is entered interactively or read from a script -- $LINENO should always expand to the same value at the same line number within that function. It shouldn't depend on where the function definition comes from. I think that's what the people from the SUS/POSIX committee wanted to say. Therefore my opinion is that FreeBSD's current behaviour is fine, and bash is wrong. By the way, SUSv3 also mentions $LINENO in the Shell Command Language Rationale (xrat/xcu_chap02) in the explanation of the $PS4 variable used for debugging with "set -x": === QUOTE === PS4 This variable is used for shell debugging. For example, the following script: PS4='[${LINENO}]+ ' set -x echo Hello writes the following to standard error: [3]+ echo Hello === /QUOTE === I'm not sure which behaviour makes more sense here. It depends on how you look at it, I guess. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "If you aim the gun at your foot and pull the trigger, it's UNIX's job to ensure reliable delivery of the bullet to where you aimed the gun (in this case, Mr. Foot)." -- Terry Lambert, FreeBSD-hackers mailing list. From owner-freebsd-standards@FreeBSD.ORG Fri May 30 18:47:15 2008 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A39E106566B for ; Fri, 30 May 2008 18:47:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 94F188FC23 for ; Fri, 30 May 2008 18:47:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4UICgG1028373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 May 2008 21:12:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4UICgAg097787; Fri, 30 May 2008 21:12:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m4UICgcu097786; Fri, 30 May 2008 21:12:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 30 May 2008 21:12:42 +0300 From: Kostik Belousov To: Stefan Farfeleder Message-ID: <20080530181242.GC21317@deviant.kiev.zoral.com.ua> References: <20080530172711.GA1056@lizard.fafoe.narf.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ytgo/kJyDF3J5kSH" Content-Disposition: inline In-Reply-To: <20080530172711.GA1056@lizard.fafoe.narf.at> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua Cc: freebsd-standards@freebsd.org Subject: Re: $LINENO within functions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 18:47:15 -0000 --Ytgo/kJyDF3J5kSH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > Hi, >=20 > SUSv3 says the following about $LINENO: >=20 > "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. If the user unsets or resets > LINENO , the variable may lose its special meaning for the life of the > shell. If the shell is not currently executing a script or function, the > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > specifies the effects of the variable only for systems supporting the > User Portability Utilities option." >=20 > My initial interpretation of "or function" was that it means $LINENO > within a function should be relative to the function's beginning line. > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > of $LINENO within functions to absolute numbering, stating this is > required by POSIX. But then I wonder about the meaning of "or > function". Does it mean functions in interactive scripts? Because for > functions in shell scripts the mentioning of both "script" and > "function" seems redundant. I do not know whether you need this data, but ksh93 and pdksh exhibit the same behaviour as bash. For the rev. 1.1 of lineno.0, I got 2 3 6 7 12 13 foo foo 2 On the other hand, zsh produces 2 3 1 2 12 13 foo foo 2 --Ytgo/kJyDF3J5kSH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkhAQ5kACgkQC3+MBN1Mb4gWtACeP2F4UcaZwQFkNEzZcYmApo8y hpsAmwSC7SJE/s5CajEgkYAknmkBVom8 =RZG6 -----END PGP SIGNATURE----- --Ytgo/kJyDF3J5kSH-- From owner-freebsd-standards@FreeBSD.ORG Fri May 30 18:47:16 2008 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4561065676 for ; Fri, 30 May 2008 18:47:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id DEDF18FC1D for ; Fri, 30 May 2008 18:47:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4UIFTQZ028464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 May 2008 21:15:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m4UIFTvK097862; Fri, 30 May 2008 21:15:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m4UIFTiH097861; Fri, 30 May 2008 21:15:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 30 May 2008 21:15:29 +0300 From: Kostik Belousov To: Stefan Farfeleder Message-ID: <20080530181529.GD21317@deviant.kiev.zoral.com.ua> References: <20080530172711.GA1056@lizard.fafoe.narf.at> <20080530181242.GC21317@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="52aklQ8BZHJhx2Z3" Content-Disposition: inline In-Reply-To: <20080530181242.GC21317@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua Cc: freebsd-standards@freebsd.org Subject: Re: $LINENO within functions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 18:47:16 -0000 --52aklQ8BZHJhx2Z3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 30, 2008 at 09:12:42PM +0300, Kostik Belousov wrote: > On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > > Hi, > >=20 > > SUSv3 says the following about $LINENO: > >=20 > > "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. If the user unsets or resets > > LINENO , the variable may lose its special meaning for the life of the > > shell. If the shell is not currently executing a script or function, the > > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > > specifies the effects of the variable only for systems supporting the > > User Portability Utilities option." > >=20 > > My initial interpretation of "or function" was that it means $LINENO > > within a function should be relative to the function's beginning line. > > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > > of $LINENO within functions to absolute numbering, stating this is > > required by POSIX. But then I wonder about the meaning of "or > > function". Does it mean functions in interactive scripts? Because for > > functions in shell scripts the mentioning of both "script" and > > "function" seems redundant. >=20 > I do not know whether you need this data, but ksh93 and pdksh exhibit > the same behaviour as bash. For the rev. 1.1 of lineno.0, I got >=20 > 2 > 3 > 6 > 7 > 12 > 13 > foo > foo > 2 >=20 > On the other hand, zsh produces >=20 > 2 > 3 > 1 > 2 > 12 > 13 > foo > foo > 2 Oh, and /usr/xpg4/bin/sh on the fully patches Solaris 10 output is identical with the zsh one. --52aklQ8BZHJhx2Z3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkhAREAACgkQC3+MBN1Mb4gFHQCcDFBQCWRK2E+kUbaLtStA1Lzr RzYAnArb2W1EibQJmwrgDweI+VSb5OrM =x9Xp -----END PGP SIGNATURE----- --52aklQ8BZHJhx2Z3-- From owner-freebsd-standards@FreeBSD.ORG Fri May 30 19:30:01 2008 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 109931065675 for ; Fri, 30 May 2008 19:30:01 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep32-int.chello.at (viefep32-int.chello.at [62.179.121.50]) by mx1.freebsd.org (Postfix) with ESMTP id 818378FC21 for ; Fri, 30 May 2008 19:30:00 +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 <20080530192958.FTWP25835.viefep32-int.chello.at@lizard.fafoe.narf.at>; Fri, 30 May 2008 21:29:58 +0200 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 94A78BAD1; Fri, 30 May 2008 21:29:29 +0200 (CEST) Date: Fri, 30 May 2008 21:29:29 +0200 From: Stefan Farfeleder To: Kostik Belousov Message-ID: <20080530192929.GB1056@lizard.fafoe.narf.at> Mail-Followup-To: Kostik Belousov , freebsd-standards@freebsd.org References: <20080530172711.GA1056@lizard.fafoe.narf.at> <20080530181242.GC21317@deviant.kiev.zoral.com.ua> <20080530181529.GD21317@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080530181529.GD21317@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-standards@freebsd.org Subject: Re: $LINENO within functions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 19:30:01 -0000 On Fri, May 30, 2008 at 09:15:29PM +0300, Kostik Belousov wrote: > On Fri, May 30, 2008 at 09:12:42PM +0300, Kostik Belousov wrote: > > On Fri, May 30, 2008 at 07:27:12PM +0200, Stefan Farfeleder wrote: > > > Hi, > > > > > > SUSv3 says the following about $LINENO: > > > > > > "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. If the user unsets or resets > > > LINENO , the variable may lose its special meaning for the life of the > > > shell. If the shell is not currently executing a script or function, the > > > value of LINENO is unspecified. This volume of IEEE Std 1003.1-2001 > > > specifies the effects of the variable only for systems supporting the > > > User Portability Utilities option." > > > > > > My initial interpretation of "or function" was that it means $LINENO > > > within a function should be relative to the function's beginning line. > > > Now I'm not so sure anymore. Bash release 2.05b changed the expansion > > > of $LINENO within functions to absolute numbering, stating this is > > > required by POSIX. But then I wonder about the meaning of "or > > > function". Does it mean functions in interactive scripts? Because for > > > functions in shell scripts the mentioning of both "script" and > > > "function" seems redundant. > > > > I do not know whether you need this data, but ksh93 and pdksh exhibit > > the same behaviour as bash. For the rev. 1.1 of lineno.0, I got > > > > 2 > > 3 > > 6 > > 7 > > 12 > > 13 > > foo > > foo > > 2 > > > > On the other hand, zsh produces > > > > 2 > > 3 > > 1 > > 2 > > 12 > > 13 > > foo > > foo > > 2 > > Oh, and /usr/xpg4/bin/sh on the fully patches Solaris 10 output is identical > with the zsh one. Yes, the current implementation has a +1 offset compared to zsh. The reason is that $LINENO can occur on the same line as the function name itself (ie. zsh prints 0 for 'f() { echo $LINENO }' which contradicts the specification).