From: Johannes Sixt Date: Mon, 05 Sep 2011 07:54:25 GMT Subject: Re: [PATCH] shell portability: Use sed instead of non-portable variable expansion Message-ID: <4E648031.6050607@viscovery.net> In-Reply-To: <7vbouzxy7g.fsf@alter.siamese.dyndns.org> Am 9/5/2011 9:09, schrieb Junio C Hamano: > By the way, t9010 uses ${#parameter} (strlen) which is bashism we forbid, > and it needs to be rewritten (David CC'ed). Actually, no. It is perfectly valid POSIX. So we would need this patch. --- 8< --- From: Johannes Sixt Subject: [PATCH] CodingGuidelines: ${#parameter} is POSIX and should be allowed See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02. Signed-off-by: Johannes Sixt --- Documentation/CodingGuidelines | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index fe1c1e5..df0b620 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -52,8 +52,6 @@ For shell scripts specifically (not exhaustive): - No shell arrays. - - No strlen ${#parameter}. - - No pattern replacement ${parameter/pattern/string}. - We use Arithmetic Expansion $(( ... )). -- 1.7.7.rc0.211.g5ac7e