bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation issue


From: Greg Wooledge
Subject: Re: Documentation issue
Date: Mon, 30 Oct 2017 08:31:10 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Oct 30, 2017 at 12:05:51AM -0400, Eli Barzilay wrote:
> Again, `unset` has different expectations, because it seems like it
> would be a special construct

Only to you, and only because you brought in some expectations from
a different language.

> -- since it's dealing with *lvalues*.

wooledg:~$ man bash | grep -i lvalue
wooledg:~$ 

Concepts from other languages do not work the same way in bash.


Here's a paragraph from bash(1):

       The unset builtin is used to  destroy  arrays.   unset  name[subscript]
       destroys  the array element at index subscript.  Negative subscripts to
       indexed arrays are interpreted as described above.  Care must be  taken
       to  avoid  unwanted  side  effects caused by pathname expansion.  unset
       name, where name is an array, or unset name[subscript], where subscript
       is * or @, removes the entire array.

This has two unquoted instances of name[subscript].  You could put quotes
around those to provide better examples.  (The man page as a whole is
quite short on examples.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]