Answer the question
In order to leave comments, you need to log in
How to use the path to the running script as a path to another folder?
Here is the simplest script that I run to specify the path to the database:
--dbpath <path_to_some_folder>/data/db
In this case <path_to_some_folder>
, this is the path to the folder where the script is located. But when copying it to another folder, I have to manually change it <path_to_some_folder>
to the path to the folder from which I run it. I would like the script to add the path to itself to the path to the database. Namely, like this:
--dbpath <path_to_the_script_folder>/data/db
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question