GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem using sed in swinstall postinstall script
Operating System - HP-UX
1846636
Members
1617
Online
110256
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
Forums
Discussions
Discussions
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
05-20-2005 06:32 AM
05-20-2005 06:32 AM
I am creating a SD.package (using swpackage) to make some simple site configuration changes to our machines. One of the changes is to alter the default directory for root from / to /root.
My postinstall script has the following lines:
sed '1s.:/:.:/root:.p' /etc/passwd >/tmp/passwd
mv /tmp/passwd /etc/passwd
When I run this script from a regular shell prompt, it works great. This:
root:*:0:3::/:/sbin/sh
becomes
root:*:0:3::/root:/sbin/sh
But, when I install the SD.package, and the script runs as a postinstall script, this:
root:*:0:3::/:/sbin/sh
becomes
root:*:0:3::/root:/sbin/sh
root:*:0:3::/root:/sbin/sh
In other words, I get 2 lines in the /etc/passwd file.
There are a few other sed commands in the script and the same thing happens for each sed command. I get double the lines in the output file.
Any suggestions?
-Alan Meyer
My postinstall script has the following lines:
sed '1s.:/:.:/root:.p' /etc/passwd >/tmp/passwd
mv /tmp/passwd /etc/passwd
When I run this script from a regular shell prompt, it works great. This:
root:*:0:3::/:/sbin/sh
becomes
root:*:0:3::/root:/sbin/sh
But, when I install the SD.package, and the script runs as a postinstall script, this:
root:*:0:3::/:/sbin/sh
becomes
root:*:0:3::/root:/sbin/sh
root:*:0:3::/root:/sbin/sh
In other words, I get 2 lines in the /etc/passwd file.
There are a few other sed commands in the script and the same thing happens for each sed command. I get double the lines in the output file.
Any suggestions?
-Alan Meyer
" I may not be certified, but I am certifiable... "
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2005 06:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2005 07:31 AM
05-20-2005 07:31 AM
Re: problem using sed in swinstall postinstall script
That was it, thank you for your tip.
-Alan
-Alan
" I may not be certified, but I am certifiable... "
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.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP