bash: Use regular expression to delete all patterns in a variable value.



  • Take into account the main readme for this section. README first.

    Syntax is:
    ${name//pattern} delete all matches of pattern.

    $ echo $ClimateChange
    2021NoDeforestation2021
    $ Amazon=${ClimateChange//2021}
    $ echo $Amazon
    NoDeforestation
    

Log in to reply
 

© Lightnetics 2024