# Revision history [back]

I am not sure about your question, but you can get the directory that contains the sage command as follows (in my case, it is /opt/sagemath/sage-source):

sage: import os
sage: os.getenv('SAGE_ROOT')
'/opt/sagemath/sage-source'


I am not sure about your question, but question,so perhaps could you make explicit which script you want to run, from where, how it calls Sage, etc. Anyway, note that from a Sage interpreter, you can get the directory that contains the sage command as follows (in my case, it is /opt/sagemath/sage-source):

sage: import os
sage: os.getenv('SAGE_ROOT')
'/opt/sagemath/sage-source'


I am not sure about your question,so perhaps could you make explicit which script you want to run, from where, how it calls Sage, etc. etc, so that we can make an adapted answer.

Anyway, note that from a Sage interpreter, you can get the directory that contains the sage command as follows (in my case, it is /opt/sagemath/sage-source):

sage: import os
sage: os.getenv('SAGE_ROOT')
'/opt/sagemath/sage-source'