[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#le
From: |
Greg Wooledge |
Subject: |
Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length} |
Date: |
Mon, 24 Oct 2016 08:26:59 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Oct 21, 2016 at 09:19:08PM -0700, L. A. Walsh wrote:
> Eduardo Bustamante wrote:
> >what's wrong with?:
> >echo ${#array[@]}
> Not when "-u" is set, which I often have on to help catch misspellings.
>
> set -u
> echo ${#array[@]}
> bash: array: unbound variable
See http://mywiki.wooledge.org/BashFAQ/112
set -u is almost as bad as set -e. It's a poorly implemented crutch
which breaks scripts that would otherwise work.
If you're going to file bug reports about your scripts breaking when
you use set -u, you should at least mention that in the initial bug
report.
- 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, L. A. Walsh, 2016/10/21
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, Eduardo Bustamante, 2016/10/22
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, Chet Ramey, 2016/10/24
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, L. A. Walsh, 2016/10/24
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, Chet Ramey, 2016/10/28
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, L. A. Walsh, 2016/10/28
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, Chet Ramey, 2016/10/28
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, L. A. Walsh, 2016/10/29
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, Chet Ramey, 2016/10/29
- Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}, L. A. Walsh, 2016/10/29