- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: sed command giving an error
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
тАО03-21-2008 07:56 AM - last edited on тАО01-20-2014 02:04 AM by Lisa198503
тАО03-21-2008 07:56 AM - last edited on тАО01-20-2014 02:04 AM by Lisa198503
sed command giving an error
Hi,
Will somebody please help me ?
When I execute this ....
paste -s -d"^m" swagent.log | sed '{s/\"\./\"\.\n/g}' > swagent.new
I get following error.
sed: Function {s/\"\./\"\.\n/g} cannot be parsed.
P.S. This thread has been moved from HP-UX>General to HP-UX > languages. -HP Forum Moderator
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 08:29 AM
тАО03-21-2008 08:29 AM
Re: sed command giving an error
Drop the curly braces:
# sed 's/\"\./\"\.\n/g'
That said, what are you attempting to do? On HP-UX there is 'ux2dos' and 'dos2ux' to convert between Unix and DOS (Windows) line terminations. See the manpages for 'dos2ux'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 10:14 AM
тАО03-21-2008 10:14 AM
Re: sed command giving an error
You also seem to have a "\" before the double quote. This isn't needed and may mess you up.
You might explain what you are doing. You seem to be adding CRs. Then you seem to be adding newlines but not after the CRs, after '".'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 10:32 AM
тАО03-21-2008 10:32 AM
Re: sed command giving an error
Thanks for quick response.
When I tried this without {}
This is the error
paste -s -d"^m" swagent.log | sed 's/\"\./\"\.\N/g' > swagent.new
Error which I got :--
sed: Memory allocation failed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 10:44 AM
тАО03-21-2008 10:44 AM
Re: sed command giving an error
> sed: Memory allocation failed.
Again, exactly what is your objective?
Your command creates one HUGH single-line file that is longer than your 'sed' buffers can tolerate.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 10:59 AM
тАО03-21-2008 10:59 AM
Re: sed command giving an error
After that I did run swverify \*
It generated a log file.
Please find attached doc.
I want to merge 1st and 2nd line, 3rd and 4th line ...........
That is why I'm using sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 11:06 AM
тАО03-21-2008 11:06 AM
Re: sed command giving an error
> By mistake in HP UX, I have changed the owner and gid of all the files. After that I did run swverify \* ...I want to merge 1st and 2nd line, 3rd and 4th line ...
If you are trying to correct the permissions and ownership, you can use 'swverify' to do this!
# swverify -F \*
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 11:11 AM
тАО03-21-2008 11:11 AM
Re: sed command giving an error
I was not knowing this.
Will this fix errors?
How can I fix these errors ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 11:21 AM
тАО03-21-2008 11:21 AM
Re: sed command giving an error
If you want to do this, use awk:
awk '
{
getline second
print $0, second
}' swagent.log
You can use sed but it's much harder to understand/remember:
sed -e 'N; s/\n/ /' swagent.log
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2008 11:22 AM
тАО03-21-2008 11:22 AM
Re: sed command giving an error
From the 'swverify(1M)' manpages:
"-F Runs vendor-specific fix scripts to correct and report problems on installed software. The fix script can create missind directories, correct file modifications (mode, owner, group, major, and minor), and recreate symbolic links."
Regards!
...JRF...