1

In a makefile, what is the difference between

python:
    exec python

and

python:
    python

I found it here. I understand that exec replaces the shell with the command being executed, in this case python. But I don't really see the implications in a makefile.

So why would i use exec python rather than python?

Bastian Venthur
  • 12,515
  • 5
  • 44
  • 78

1 Answers1

1

The exec command is useful for specific cases when writing scripts. One such example is when we want an application to run without access to a shell process after execution. You can read more about those use cases here.

For the situation you gave, there is no practical difference between exec python and python, other than not being able to return to your shell after python is finished executing with the exec command. You're better off just using python.

mgries
  • 38
  • 5