在Makefile中,有时会遇到大小写转换的情况。
- 小写转成大写
UPPER = $(shell echo $(LOWER) | tr a-z A-Z)
- 大写转成小写
LOWER = $(shell echo $(UPPER) | tr A-Z a-z)
另外在shell中转换的方法
teststr=abcDEF
- 小写转成大写
UPPER=${teststr^^}
- 大写转小写
UPPER=${teststr,,}
在Makefile中,有时会遇到大小写转换的情况。
UPPER = $(shell echo $(LOWER) | tr a-z A-Z)
LOWER = $(shell echo $(UPPER) | tr A-Z a-z)
另外在shell中转换的方法
teststr=abcDEF
UPPER=${teststr^^}
UPPER=${teststr,,}