0

In Linux, I type:

/home/vincent/anaconda3/bin/python :
this does go to the python shell, no problem.

Now if I try to create a variable for that link such as: PYTHONEXEC=/home/vincent/anaconda3/bin/python
If I type PYTHONEXEC I receive command not found.

This is to create a variable in a crontab, but it also doesn't work when used in the shell.

1
  • variables usually need $PYTHONEXEC to be interpolated, which exactly PYTHONEXEC lacks
    – thrig
    Mar 1, 2018 at 17:08

1 Answer 1

3

This simplest solution here is to tell your shell to expand the PYTHONEXEC variable before running it; you do that by prefixing a $, as thrig commented:

$PYTHONEXEC

If you are going to use that syntax in a crontab entry, you'll need to source a file that defines the variable before using it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .