In bash 4 (and above), to capitalize the first letter of a string stored in variable L1
, I can do the following:
L1=en
Ll1=${L1^}
echo $Ll1
This prints En
.
I'm trying to do something similar within a Makefile, but I can't get the ${L1^}
syntax to work.
SHELL := /bin/bash
L1 = en
Ll1 := $(shell echo ${L1^})
all:
@echo $(Ll1)
Produces blank output.
Can I get this to work with this kind of bash syntax without resorting to tr/sed?
P.S. I do need to assign it to a variable and not echo it directly. I'm using bash 4.3.48 and GNU make 4.1.
$(shell echo $${$(L1)^})
– Lorettalorette