[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash string RE pattern matching
From: |
Lawrence Velázquez |
Subject: |
Re: bash string RE pattern matching |
Date: |
Wed, 26 Jul 2023 20:54:57 -0400 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-592-ga9d4a09b4b-fm-defalarms-20230725.001-ga9d4a09b |
On Wed, Jul 26, 2023, at 7:13 PM, Lee wrote:
> Why doesn't =~ match strings inside of double quotes?
>
> $ bash bashre
> os = "Linux" re = "^Linux"
> "$os" =~ ${re} is true
> "$os" =~ "${re}" is False
> "$os" =~ ^Linux is true
> "$os" =~ "^Linux" is False
https://mywiki.wooledge.org/BashPitfalls#pf35
--
vq