[Top][All Lists]

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

Re: Problem with if [ -d in bash 4.3.30

From: Steve Simmons
Subject: Re: Problem with if [ -d in bash 4.3.30
Date: Tue, 9 Dec 2014 09:52:13 -0500

On Dec 9, 2014, at 9:47 AM, Stephane Chazelas <address@hidden> wrote:

> It's a bit confusing that ${VAR:-""} should be treated
> differently from ${VAR:=""}. Was there a rationale for changing
> the behaviour other than strict POSIX conformance? AFAICT, ksh
> and mksh behave differently (from bash and from each other), so
> I can't say the change helps much with portability here.

One tests and sets the variable involved, one tests but does not set the 
variable involved. It's nice to have both behaviors available, I use both.

reply via email to

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