run:
cd ..; \
@echo $(shell pwd)
Throws this:
/bin/sh: @echo: command not found
The following works, and prints current directory:
run:
@echo $(shell pwd)
Do you know why?
As the error message already suggests:
/bin/sh: @echo: command not found
The actual command that is not found is @echo
, not echo
. This issue is happening because the shell receives the single line below, since you are escaping the newline character using \
.
cd ..; @echo [output of pwd]
You could place the @
before the cd
command instead:
run:
@cd ..; \
echo $(shell pwd)
This way, the shell will receive the following line:
cd ..; echo [output of pwd]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With