LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 08-23-2006, 05:06 PM   #1
fatjack
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Rep: Reputation: 0
'sed: command garbled:' error on Solaris


Command below runs fine on Linux but gives 'sed: command garbled:' on Solaris

sed '/Upcoming/ i\<li><a href=news_events/news_letter.html>News Letter</a></li>'


Any thoughts ?
 
Old 08-23-2006, 05:22 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I'm a little rusty, but doesn't the text to be inserted have to be on a new line?
Code:
sed '/Upcoming/ i\
<li><a href=news_events/news_letter.html>News Letter</a></li>'
 
Old 08-24-2006, 01:27 AM   #3
SierraKilo
LQ Newbie
 
Registered: Jun 2004
Location: Germany
Distribution: Various Ubuntu LTS
Posts: 22

Rep: Reputation: 15
This works on SunOS sulu 5.9 Generic_118558-26 sun4u sparc SUNW,UltraAX-i2

echo Upcoming | sed 's/Upcoming/i\<li\>\<a href=news_events\/news_letter.html\>News Letter\<\/a\>\<\/li\>/'
 
Old 08-25-2006, 05:15 PM   #4
fatjack
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for help guys.

I was trying to insert the text before the line containing the word 'Upcoming' Steve's version of command does that perfectly well.

Sk your version though runs fine replaces the text 'Upcoming'.

Thanks again,
Shikhar
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sed error message:extra characters after the command wmh830621 Programming 4 08-14-2006 07:13 PM
sed command ancys Programming 3 08-05-2006 09:30 AM
how to find sed version in solaris msgforsunil Solaris / OpenSolaris 7 07-27-2006 03:05 AM
Windows and FC3 and Solaris---and only Solaris boot error message zillah Linux - Laptop and Netbook 1 07-07-2005 10:17 PM
sed error message: extra characters after the command. nano_mag Linux - General 3 05-15-2005 01:00 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration