Can my program edit/update the users .profile/.bashrc/.cshrc files to set program executable as environment variable

39 views Asked by At

I have an application and it is docker containerized, which contains the program executable and other stuff.

Now how can I make the executable name as a linux environment variable(permanently and not the terminal temporary)?

One option that I have is to edit .profile/.bashrc/.cshrc from some script and add add the PATH variable, however I believe this is not a good idea to follow.

Edit: My only requirement is that the executable should be an environment variable whenever any user pulls and uses the image.

1

There are 1 answers

0
kat_16 On

I copied the executable in my user/bin area while containerization it, the image will contain the exe in the /bin area which will make it work for all the users while pulling the image.