1828145 Members
2856 Online
109975 Solutions
New Discussion

Need a script

 
pharthiphan
New Member

Need a script

Hi,

Need to set the path variable in .profile of all users in the system there are around 80 users so doing it manually is difficult.

can i get a script to do that.

Regards,
Pharthi
11 REPLIES 11
Horia Chirculescu
Honored Contributor

Re: Need a script

Hello,

Why do not set the variable in /etc/profile and this would be viable for all your local users?

Horia.
Best regards from Romania,
Horia.
likid0
Honored Contributor

Re: Need a script

As horia says just popit in the /etc/profile, all users will source it when logging in.
Windows?, no thanks
pharthiphan
New Member

Re: Need a script

will that work with reboot..

regards,
Pharthi
pharthiphan
New Member

Re: Need a script

downtime is critical so can anyone help me with script
Dennis Handly
Acclaimed Contributor

Re: Need a script

>will that work with reboot.

Sure. They will have to re-login. Or source /etc/profile.
Dennis Handly
Acclaimed Contributor

Re: Need a script

>will that work with reboot.

Oops, I read this as:
will that work without a reboot.

Sure. But they will have to re-login. Or source /etc/profile.
pharthiphan
New Member

Re: Need a script

sorry what i am asking whether by adding path variable into /etc/profile will work without rebooting the server.

any alternate solution without reboting the server

regards,
Pharthi
Sachin Kumbla
Frequent Advisor

Re: Need a script

Hi

As Dennis said

Reboot of the server is not reqd.
Only the users have to log out & login again to take the changes made in /etc/profile.

Note:even if you edit the .profile file users have to log out & login.

Rgds.,
Sachin kumbla

pharthiphan
New Member

Re: Need a script

no after logout and login it is not working.

Regards,
Pharthi
Dennis Handly
Acclaimed Contributor

Re: Need a script

>Sachin: Note: even if you edit the .profile file users have to log out & login.

Not really. If they source the appropriate files, they don't need to re-login. It may be much easier to explain re-logging in than sourcing.
Dennis Handly
Acclaimed Contributor

Re: Need a script

>after logout and login it is not working.

What did you change? /etc/profile?
A user's profile can completely ignore any settings in /etc/profile, you may have to change both.