Review your favorite Linux distribution.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
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.


  Search this Thread
Old 08-23-2006, 05:06 PM   #1
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
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
I'm a little rusty, but doesn't the text to be inserted have to be on a new line?
sed '/Upcoming/ i\
<li><a href=news_events/news_letter.html>News Letter</a></li>'
Old 08-24-2006, 01:27 AM   #3
LQ Newbie
Registered: Jun 2004
Location: Germany
Distribution: RedHat 8,9 / FC1,2,3,5
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
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,


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 03:22 AM.

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