LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-25-2007, 02:11 AM   #1
bengoavs
LQ Newbie
 
Registered: Jun 2006
Posts: 20

Rep: Reputation: 0
Neutralize user's environment


We have some automation tool written in bash. The tool is independent and doesn't require settings of environment before running it. But, it seems that certain envs mess up with it and make it fail.

How can a user's environment (.bashrc in that case) can be neutralized?

Thanks!
Ben

Last edited by bengoavs; 12-25-2007 at 04:01 AM.
 
Old 12-25-2007, 03:41 AM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Whenever you make a user, the .bashrc and .bash_profile should be the same unless users are modifying it themselves. To make environment variables consistent for all users, look at /etc/profile.

-twantrd
 
Old 12-25-2007, 03:53 AM   #3
usernamenumber
Member
 
Registered: Sep 2003
Location: Somerville, MA
Distribution: Fedora/RHEL currently. Red Hat, Slackware, Debian, SuSe and Mandrake at other times
Posts: 104

Rep: Reputation: 15
I'm not sure if it's possible to wipe all environment variables, or that you would wan to. But you can unset specific variables with a line like:

unset varname
 
Old 12-25-2007, 03:59 AM   #4
bengoavs
LQ Newbie
 
Registered: Jun 2006
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
To make environment variables consistent for all users, look at /etc/profile.
I'm aware of that. Can't force a golbal environment. Just want to neutralize it

Last edited by bengoavs; 12-25-2007 at 04:02 AM.
 
Old 12-25-2007, 05:21 AM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Like what 'usernamenumber' mentioned above? Give us an example so maybe we can provide you some better ideas on how to tackle this problem.

-twantrd
 
Old 12-25-2007, 07:44 AM   #6
bengoavs
LQ Newbie
 
Registered: Jun 2006
Posts: 20

Original Poster
Rep: Reputation: 0
Let's say my tool uses some modules at /mod (everything is in clearcase, but just for the simple demonstration).

A certain user has a .bashrc with LD_LIBRARY_PATH=/whatever

It runs over the script env, and causes errors
 
Old 12-25-2007, 04:17 PM   #7
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Ok, then why not just export all the env variables you need within your automated script?

-twantrd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the user's name? xpucto Linux - Newbie 2 08-23-2007 06:04 AM
user's rights drummerdan Slackware 2 03-26-2006 03:32 PM
user's authority Xiangbuilder Linux - Newbie 1 12-29-2004 09:32 AM
Sudo User's LinuxRam Linux - General 5 08-19-2004 11:49 AM
add new user's ??? qwijibow Linux - Newbie 3 08-27-2003 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration