1

When defining a command as a constant within a Makefile:

MY_COMMANDLINE="prog arg1 arg2" 

and using this constant later to get the command invoked, you could get:

/bin/sh: prog arg1 arg2: not found 

although prog definitely exists.
Explicitly giving the whole path of prog does not help.


There are other questions regarding shell saying "not found" (e.g. this or that). By linking this question others may find this possible cause easier.

1

1 Answer 1

1

Unlike e.g. in shell scripts the quotes become part of the string and get transferred to the shell, which obviously then searches for the whole path incl. all spaces.

Defining the command line without quotes:

MY_COMMANDLINE=prog arg1 arg2 

works.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.