Re: [PATCH] Update bash completions to prevent unbound variable errors.

From
Adeodato Simó <hidden>
Date
2016-06-15 22:45:56
Reply to
Boyd Stephen Smith Jr., 2016-06-15
* Boyd Stephen Smith Jr. [Mon, 12 Jan 2009 14:35:35 -0600]:
quoted
The attached patch replaces things like
quoted
        if [ -z "$1" ]
quoted
with
quoted
        if [ -z "${1-}" ]
That looks ugly to me.  Any reason we shouldn't just "set +u" at the top of 
the script?
`set +u` affects the shell globally, not just to the sourced file. If
you do that, you must be aware that you'll be preventing people from
running their shell in `set -u` mode. (Merely stating a fact here, not
giving any opinion.)

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
The problem I have with making an intelligent statement is that some
people then think that it's not an isolated occurrance.
                -- Simon Travaglia
Thread (14 messages) 14 messages, 4 authors, last reply 2016-06-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help