Links, using environment variables, with the same name, for all users at the same time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Links, using environment variables, with the same name, for all users at the same time
# 1  
Old 01-30-2012
Links, using environment variables, with the same name, for all users at the same time

Hi all!

I have the following problem:

I want to create a symbolic link at the root: /a
which points to the folder: /b/MyFiles

It's simple, but here comes the troubling part. If I log in with an other user at the same time, I would like to see the following under a:

/b/HisFiles

so another folder, which contains his files.

It would be like a version control system, when you log in, something happens (environment variables are set, link is configured), and the link shows to your files, but if someone else log in, the link uses his settings, to point to his files while you can use it like nothing has happened.

Do you know any solution for it?

If the explanation is not clear, please tell me, I'm kinda new at foruming :$
# 2  
Old 01-30-2012
A link cannot point to more than one different place at the same time. I would forget using a link and look at using an environment variable in the user's profile (assuming some sort of Bourne-like shell).

Code:
# In user 1 profile
VCS_DIR=/b/MyFiles
export VCS_DIR

Code:
# In user 2 profile
VCS_DIR=/b/HisFiles
export VCS_DIR

Hard to be more specific because we don't know what Operating System and version you have or what Shell you prefer.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Environment Variables

1. The problem statement: What is the mesg value set for your environment? If it is on, how would you turn off your current session? How would you set it permanently? 3. The attempts at a solution : Read Unix The textbook. 3rd chapter has many things like environment variables and... (5 Replies)
Discussion started by: mahinkhan22
5 Replies

2. Shell Programming and Scripting

Environment variables

I have read tons of posts about how you can't set persisting environment variable in a child script of a shell and have it persist. The only way is to source a file as % . <scriptname> I am finding that true... but I know there is a way around it. I just don't know how. I worked for 6... (5 Replies)
Discussion started by: rwa25
5 Replies

3. UNIX for Dummies Questions & Answers

Environment variables

why are all environment variables represented in a fixed format regardless of the shell you use? like $HOME $PATH etc (6 Replies)
Discussion started by: sravani
6 Replies

4. Solaris

Will creating symbolic links affect users

Hi, I have a quick question with regards to creating symbolic links. Would creating a symbolic link from one directory to a file in another cause any issues for users that are currently logged into the box. I don't believe it will unless they are using the file in question, but I would like... (2 Replies)
Discussion started by: Chains
2 Replies

5. UNIX for Dummies Questions & Answers

Can I export the users environment using sudo?

I want the user to be able to commands as another user.. but when they do that.. I need them to have the environment variables of the other user. is this possible with sudo? sudo -H -u user env 'env' is giving me the environment of the current user, not the user I want to run commands as. ... (1 Reply)
Discussion started by: julesdiane
1 Replies

6. Solaris

Add environment variables for all users

hi I need to add environment variables for all users and make them available when they login. I don't know which file to edit. Also these variables should be displayed when "env" command is executed. Please help....which file is common for all users, without editing their specific .profile or... (2 Replies)
Discussion started by: ashish_uiit
2 Replies

7. UNIX for Advanced & Expert Users

Managing Users in a Global Environment

Hello, I am interested in your strategy for handling engineers Unix accounts when the engineers must log in to resources in a variety of locals in a global environment. The engineers home directory and normal environment is local to where the engineer is sitting. When they log in to a remote... (0 Replies)
Discussion started by: Randal
0 Replies

8. Shell Programming and Scripting

Extracting a users environment variables

Hi Guys, I want to extract users environment variables via a sh script, and for some reason it is not working. According to the su man page: Example 3: Executing command with user bin's Environment and Permissions To execute command with the temporary environment and per-... (2 Replies)
Discussion started by: Tornado
2 Replies

9. Programming

environment variables

hi, I want to create a new EV(Environment Variable) through a c program and I done this thing through setenv() method. But the newly created EV is not permanent, i.e. when I exit from the program the EV also no longer lives. But I want to make it a permanent EV for the current user. Actually I... (6 Replies)
Discussion started by: sumsin
6 Replies

10. UNIX for Dummies Questions & Answers

help..Environment variables...

hi, 1). i would like to know what is meant by environment variables? 2). is the number of envi variables is a constant number for unix systems? 3). how to see the list of envi variables (and the values of the envi variables)in a single command? 4). if this questions were already asked... (3 Replies)
Discussion started by: sekar sundaram
3 Replies
Login or Register to Ask a Question