Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    just double the $. baz -n $${bar:9:-1}. But each line is executed in a different shell, so you should put them on the same line: bar=`abc|xyz`; baz -n $${bar:9:-1}, otherwise the bar variable will be empty. Commented Apr 2, 2020 at 6:15
  • 2
    Note that the shell command from a Makefile will by defnition be executed in a typically POSIX compliant shell and that does not support the expression ${bar:9:-1} because this uses a ksh/bash extension. Commented Apr 2, 2020 at 7:38