From 99f6aae983a04bf65c5fe6809f51dab2f1d50c21 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 16 Apr 2018 00:22:28 +0000 Subject: [PATCH] move text on ${array} => ${array[0]} implicitly, it is more global --- mksh.1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mksh.1 b/mksh.1 index aa67ac9..d9a8076 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,8 +1,9 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.451 2017/08/16 21:40:14 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.452 2018/04/16 00:22:28 tg Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -.\" 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 +.\" 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, +.\" 2018 .\" mirabilos .\" .\" Provided that these terms and disclaimer and all copyright notices @@ -76,7 +77,7 @@ .\" with -mandoc, it might implement .Mx itself, but we want to .\" use our own definition. And .Dd must come *first*, always. .\" -.Dd $Mdocdate: August 16 2017 $ +.Dd $Mdocdate: April 16 2018 $ .\" .\" Check which macro package we use, and do other -mdoc setup. .\" @@ -1364,6 +1365,10 @@ or where .Ar name is a parameter name. +Substitutions of an an array in scalar context, i.e. without an +.Ar expr +in the latter form mentioned above, expand the element with the key +.Dq 0 . Substitution of all array elements with .Pf ${ Ns Ar name Ns \&[*]} and @@ -1519,11 +1524,7 @@ on it; if .Ar word is not needed, it is not evaluated. .Pp -The following forms of parameter substitution can also be used (if -.Ar name -is an array, the element with the key -.Dq 0 -will be substituted in scalar context): +The following forms of parameter substitution can also be used: .Pp .Bl -tag -width Ds -compact .It Pf ${# Ns Ar name Ns \&}