bug-bash
[Top][All Lists]
Advanced

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

Re: parameter expansion with `:` does not work


From: Kerin Millar
Subject: Re: parameter expansion with `:` does not work
Date: Thu, 8 Jul 2021 02:51:15 +0100

On Thu,  8 Jul 2021 02:54:06 +0200 (CEST)
lisa-asket@perso.be wrote:

> As I was in it, have also changed  
> 
> 
> 
> fdir=${fdir:-$PWD}

This makes sense.

> 
> 
> 
> to 
> 
> 
> 
> fdir=${fdir:=$PWD} 

Here, you are using a form of parameter expansion that intrinsically performs 
variable assignment, only to redundantly assign the result of the expansion to 
the same variable once again. In a roundabout fashion, it ends up proving 
Greg's point. I'd suggest temporarily disavowing yourself of the 
${parameter:=word} form, for the time being.

-- 
Kerin Millar



reply via email to

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