Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/bin/sh: @echo: command not found

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?

like image 297
Chris G. Avatar asked Sep 18 '25 17:09

Chris G.


1 Answers

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]
like image 140
ネロク・ゴ Avatar answered Sep 20 '25 08:09

ネロク・ゴ