[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error message garbage when parameter expansion used inside (()) and
From: |
Greg Wooledge |
Subject: |
Re: Error message garbage when parameter expansion used inside (()) and variable unset |
Date: |
Tue, 3 Apr 2018 08:09:37 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Apr 02, 2018 at 04:16:54PM -0500, PRussell wrote:
> The above tells us what happens to an unset variable if not using parameter
> expansion.
>
> But if a shell variable uses parameter expansion and is null or unset, what
> does it evaluate to inside (()) syntax?
The parameter expansion is performed exactly as you would expect,
resulting in an empty string, and most likely a syntax error.
> ./tt: line 18: var1: var1 == : syntax error: operand expected (error token
> is "== ")
Yes, like that. So don't do that. This is a bug in your script, not
in bash.
- Error message garbage when parameter expansion used inside (()) and variable unset, PRussell, 2018/04/02
- Re: Error message garbage when parameter expansion used inside (()) and variable unset,
Greg Wooledge <=
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Daniel Mills, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Chet Ramey, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, PRussell, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Greg Wooledge, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Chet Ramey, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, PRussell, 2018/04/03
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Chet Ramey, 2018/04/04
- Re: Error message garbage when parameter expansion used inside (()) and variable unset, Chet Ramey, 2018/04/04