- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sed command cannot be parsed
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
Discussions
Discussions
Forums
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
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
тАО11-29-2001 09:58 AM
тАО11-29-2001 09:58 AM
I have a sed command that works fine on both Solaris and Linux, but fails on HP-UX. It is for a nightly build process, and is the last piece that I need to port. I am not extremely familiar with sed, so bombard me with corrections! :D
The sed statement is:
sed '/build.rev/c\build.rev = '"$BUILD_ID"'' $BUILD_ID_FILE > $BUILD_ID_FILE.1
I had our admin apply both PHCO_22800 (sed cumulative patch) and PHCO_22760 (libc cumulative patch), but it did not help.
If there are any other sed related patches I can apply, let me know as well.
--
Shane
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 10:05 AM
тАО11-29-2001 10:05 AM
Re: sed command cannot be parsed
It would help if you can give your BUILD_ID_FILE and let us know what you are trying to do.
To replace something with a variable you will need to use ' (single quotes) not the double quotes "
for ex., yours would be
sed 's/build.rev/build.rev = '$BUILD_ID'/' $BUILD_ID_FILE
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 10:05 AM
тАО11-29-2001 10:05 AM
Re: sed command cannot be parsed
sed '/build.rev/cbuild.rev = '"$BUILD_ID"'' $BUILD_ID_FILE > $BUILD_ID_FILE.1
BTW the last two '' aren't required :-)
dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 10:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 11:21 AM
тАО11-29-2001 11:21 AM
Re: sed command cannot be parsed
#
# This file contains the base and custom revision numbers.
# Needs to be checked out and updated during the nightly
# build process.
build.rev = 1332
custom.rev = 1285
Very simple file. The line that needs to replaced is being replaced with an environment variable that is the 2-digit year plus Julian date, with the leading zero stripped, e.g., 01 + 332 = 1332.
I tried each command listed and got command cannot be parsed for two of them.
Basically, I do not know the entire line value in the file prior to the build process. If I did, I could use the 's' and substitute, but I used 'c\' to change instead. I need to grab the line that starts with /build.rev/ and replace the entire line with this:
build.rev = $NEW_BUILD_ID
Hope this helps.
--
Shane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 11:33 AM
тАО11-29-2001 11:33 AM
Re: sed command cannot be parsed
--
Shane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 11:41 AM
тАО11-29-2001 11:41 AM
Re: sed command cannot be parsed
Problem solved, monkey off back, smile on face...
--
Shane