strange problem with sed
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > strange problem with sed




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    strange problem with sed  
bernd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-04 10:34 PM

hy group

i know, this is a frequently question answered many times but...
i simply couldn't get it to work!

i try to substitute in sed a variable like:

echo "hammel=bammel" | sed -e "s/hammel/$HOME/"

i've read a lot about using doublequotes and stuff but i get:

$ echo "hammel=bammel" | sed -e "s/hammel/$HOME/"
sed: -e expression #1, char 11: Unknown option to `s'

maybe i'm just to stupid but i realy going crasy about this...

any help really appreciate

thanx in advance

bernd





[ Post a follow-up to this message ]



    Re: strange problem with sed  
Warren Block


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-04 10:34 PM

bernd <bernd@thebc.ch> wrote:

> $ echo "hammel=bammel" | sed -e "s/hammel/$HOME/"
> sed: -e expression #1, char 11: Unknown option to `s'

Hint:

echo "s/hammel/$HOME/"

--
Warren Block * Rapid City, South Dakota * USA





[ Post a follow-up to this message ]



    Re: strange problem with sed  
John Wingate


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-05-04 10:34 PM

Warren Block <wblock@wonkity.com> wrote:
> bernd <bernd@thebc.ch> wrote:
 

> Hint:

> echo "s/hammel/$HOME/"

You are not limited to using "/" as the delimiter. Warren's hint shows
why another delimiter may be useful at times.  Bernd will have better
luck with:

echo "hammel=bammel" | sed -e "s:hammel:$HOME:"

(if there are no colons in "$HOME").

--
John Wingate             Language serves three functions.  One is to
johnww@worldpath.net     communicate ideas, one is to conceal ideas, and
the third is to conceal the absence of ideas.
--Otto Jespersen





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:00 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register