- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Pointing .profile to use Environmental Variables f...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 07:47 AM
04-18-2005 07:47 AM
Currently setting up users to use 5 different environmental variable scripts located in /home/profiles. Each user will be pointed to their own corresponding script.
Things Done
1. 5 scripts created in /home/profiles directory
2. entered "exec /home/profiles/budgetprof.sh" at end of .profile in test account
3. permissions were changed on scripts in order for users to run scripts
Questions:
1. What's the proper way of sourcing these 5 scripts from the users .profile?
2. Will any additional modifications be needed to the following files in the users home directory?
.cshrc
.exrc
.login
prefs.ora
3. Any examples or suggestions would be great.
Thanks,
Doug
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 07:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 07:51 AM
04-18-2005 07:51 AM
Re: Pointing .profile to use Environmental Variables from script
export VAR1=111
export VAR2=222
This is put in a file (not-writable by a regular user) for example, /usr/local/bin/myenv.sh
Now each .profile or batch script should include this file via the dot "." command.
. /usr/local/bin/myenv.sh
myenv.sh must not contain an exit or return because this is not run as a child process but simply becomes part of the shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:24 AM
04-18-2005 08:24 AM
Re: Pointing .profile to use Environmental Variables from script
I would shy away from /home/profiles as the directory name for these "source-ins". It may cause confusion at some point down the road. Perhaps /usr/envvars or something like that instead.
All of the other files remain the same, simply add . /usr/envvars/envscript1 to the .profile in /home/julie for user "julie". [Note the 'dot-space' on the line doing the sourcing.] As stated in another post, be careful to avoid having exit in your env scripts. You can set variables, create aliases, change to a different directory, set a special system prompt, etc in this manner.
Cheers,
...Steve...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 08:25 AM
04-18-2005 08:25 AM
Re: Pointing .profile to use Environmental Variables from script
that should have been /usr/local/envvars
mea culpa!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 10:00 AM
04-18-2005 10:00 AM
Re: Pointing .profile to use Environmental Variables from script
the default files are /etc/d.profile (these are the ones copied to the /users directory)
browse through sam to see what I'm talking about in the help section of adding users.
good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 05:35 AM
04-19-2005 05:35 AM
Re: Pointing .profile to use Environmental Variables from script
Thanks for all your help. Bonus points will be awarded for any additional suggestions.
Thanks,
Doug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 06:19 AM
04-19-2005 06:19 AM
Re: Pointing .profile to use Environmental Variables from script
useradd -g users -d /home/newbie -s /usr/bin/sh -c "New User" -m -k /etc/skel2 newbie
They'll get the environment you want them to have.
bueno bye