LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   'sed: command garbled:' error on Solaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/sed-command-garbled-error-on-solaris-476734/)

fatjack 08-23-2006 05:06 PM

'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 ?

gilead 08-23-2006 05:22 PM

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>'


SierraKilo 08-24-2006 01:27 AM

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\>/'

fatjack 08-25-2006 05:15 PM

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


All times are GMT -5. The time now is 08:13 PM.