help-bash
[Top][All Lists]
Advanced

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

Re: why fail , [[ $sep$*$sep == $sep--$sep ]]


From: Greg Wooledge
Subject: Re: why fail , [[ $sep$*$sep == $sep--$sep ]]
Date: Sun, 18 Feb 2024 18:33:10 -0500

On Sun, Feb 18, 2024 at 03:56:45PM -0500, Lawrence Velázquez wrote:
> This surprises me because IFS is not lost if it's set to something
> a little less ... weird:
> 
> $ (set aa bb cc -- dd; f=+ IFS=$f; set -x; [[ $f$*$f == *"$f--$f"* ]])
> + [[ +aa+bb+cc+--+dd+ == *\+\-\-\+* ]]
> 
> Why the difference?

Without any actual knowledge of the issue, let me just point out that
bash uses $'\1' internally for a few different things, and therefore
using it in your own code sometimes triggers bugs.



reply via email to

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