- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Modify 250 user .profiles at once.
Operating System - HP-UX
1757707
Members
2234
Online
108863
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-15-2005 08:38 AM
тАО04-15-2005 08:38 AM
Modify 250 user .profiles at once.
HP-UX 11.0 L2000
We're upgrading from oracle 8i to 9i. I need to modify each user's .profile and softlink it to the appropriate directory where their new .profile is located. I know to use ln -s to create the softlink but does anyone have a script that would automate this process with 5 different .profiles and 250 users. Each user will need to be linked to one of the 5 .profiles.
Thanks,
Doug
We're upgrading from oracle 8i to 9i. I need to modify each user's .profile and softlink it to the appropriate directory where their new .profile is located. I know to use ln -s to create the softlink but does anyone have a script that would automate this process with 5 different .profiles and 250 users. Each user will need to be linked to one of the 5 .profiles.
Thanks,
Doug
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2005 08:44 AM
тАО04-15-2005 08:44 AM
Re: Modify 250 user .profiles at once.
This is rather easy with sed, Perl, or awk but rather tha doing symbolic links, let me give you a plan B:
Create your 5 different scripts to set and export the environment variables.
e.g.
/usr/local/bin/oraenv1.sh
Now each of your user's .profile won't have a symbolic link but rather will source one of these 5 files using the "." dot operator.
. /usr/local/bin/oraenv1.sh
In the future, all you have to do is make changes to one of these 5 files and nothing else needs to be touched. Also, batch files can source the appropriate file in the same way. Note: These sourced files must mot contain an exit or return statement.
Create your 5 different scripts to set and export the environment variables.
e.g.
/usr/local/bin/oraenv1.sh
Now each of your user's .profile won't have a symbolic link but rather will source one of these 5 files using the "." dot operator.
. /usr/local/bin/oraenv1.sh
In the future, all you have to do is make changes to one of these 5 files and nothing else needs to be touched. Also, batch files can source the appropriate file in the same way. Note: These sourced files must mot contain an exit or return statement.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2005 09:44 AM
тАО04-15-2005 09:44 AM
Re: Modify 250 user .profiles at once.
Clay's idea is the better way. But if you ever wanted to edit a bunch of files, perl has the "-i" option to edit in place. For instance-
perl -i -p -e 's/oracle8/oracle9/g' /home/*/.profile
would change every occurance of text oracle8 to oracle9 in all the .profile files.
HTH
-- Rod Hills
perl -i -p -e 's/oracle8/oracle9/g' /home/*/.profile
would change every occurance of text oracle8 to oracle9 in all the .profile files.
HTH
-- Rod Hills
There be dragons...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP