Reputation: 1
We have an application where one shell script file maintains all environmental variables, which are set by export. These variables are used to run external commands in the application. So, we have many users running the same application from the single server from their own home directories. When a user A run the application, the executable which are in user B path are running. But we set the environmental variables for each user so the executable is supposed to run from the user A's own path.
How can I make the executable run from the user's own path?
sample.sh
export HA_INC=/home/A/proj
export HA_EXE=/home/A/proj/bin
these above file is cloned by all users when the application is cloned from git. Whenever the user A is executing a command, which is in HA_EXE directory, the executable is running from some other users' directory. All the users are using their own shells.
Upvotes: 0
Views: 46
Reputation: 2278
I think you can have a system-wide shell script in /etc/profile.
To represent the current user's home directory, use "~". To represent B's home directory, use "~B".
Upvotes: 1