0

I have a custom tool installed on Linux. Let's call it MyLoggingTool. which MyLoggingTool reveals it's located under ~/.local/bin/MyLoggingTool.

Now I have a build process where I also use this tool but in a different way, I have to use a version located somewhere in a relative path. I cannot prefix the toolname with a path in my scripts as this would make both processes too different.

I would like to hide the toolpath of the installed one with the toolpath to my local version. How would I do sth like that? I tried to just set a variable `called MyLoggingTool, hoping it would hide the installed toolpath, but it doesn't work.

7
  • You can adjust the PATH variable, which lists the directories to be searched and the order in which they're to be searched Commented Sep 13, 2021 at 4:03
  • Yes, I could try that, but this is more of a temporary thing. Is there a way of doing that just for the current process? Commented Sep 13, 2021 at 4:06
  • Yeah, each process has its own PATH variable Commented Sep 13, 2021 at 4:10
  • You can set the PATH variable separately for the build script, or for a particular window, etc. If you're familiar with Python, that's how virtualenv works Commented Sep 13, 2021 at 4:13
  • 2
    Yes, the executable's name won't be in your env. The path to it ~/.local/bin will be in $PATH. Commented Sep 13, 2021 at 5:13

1 Answer 1

1

Ref. How to set an environment variable only for the duration of the script? and Setting environment variable for one program call in bash using env

You may alter the PATH definition specifically for your tool execution in the same mood such as:

$ PATH=~/.local/bin/MyLoggingTool:$PATH MyBuildTool
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.