Sample Header Ad - 728x90

Subset of string variable in Makefile

0 votes
1 answer
1295 views
I am relatively new to using Make. I am trying to port a shell script that has a variable that is accessed using ${var:9:-1}, however in Make as $ is reserved I cannot use this convention. I am lost as whenever I try to search for answers they are extremely verbose. eg:
foo:
		bar=abc|xyz
        baz -n ${bar:9:-1}
Asked by Vincent Rodomista (101 rep)
Apr 2, 2020, 12:04 AM
Last activity: Jun 3, 2025, 02:17 PM