Bash - String manipulation in Makefile

I've learned about string manipulation with bash, and more especially about substring replacement:

#! /bin/bash

VAR1="aaaa.bbbb.cccc"
VAR2="bbbb*"
echo ${VAR1%${VAR2}}

This bash script prints "aaaa.". I tried to include it in my makefile, but I can't make it work..

SHELL:=/bin/bash

VAR1="aaaa.bbbb.cccc"
VAR2="bbbb*"

all:
    @echo $${VAR1%$${VAR2}}

This Makefile only prints a blank line. I think I've misunderstood something, but can't figure out what. Any help would be really appreciated.

Answers


No need to put double quotes around VAR1 and VAR2. And you need to use export if you want to put VAR1 and VAR2 above all:

SHELL:=/bin/bash

export VAR1=aaaa.bbbb.cccc
export VAR2=bbbb*

all:
    @echo $${VAR1%$${VAR2}}

Need Your Help

MYSQL Syntax Error LEFT JOIN

mysql sql

Im having issues trying to figure out this syntax error. Heres the SQL query:

What is the difference between Seq Scan and Bitmap heap scan in postgres?

optimization postgresql query-optimization explain-plan

In output of explain command I found two terms 'Seq Scan' and 'Bitmap heap Scan'. Can somebody tell me what is the difference between these two types of scan? (I am using PostgreSql)