strange problem with sed

Ask a Question related to Linux / Unix Administration, Design and Development.

  1. #1

    Default strange problem with sed

    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
    bernd Guest

  2. Similar Questions and Discussions

    1. Strange Problem
      Dear All: I have used MySQL as prototype on an application that I am developing. The project has been approved and I am now moving to Oracle for...
    2. Strange Problem with XML
      Hi I am retrieving information from a DB in XML but in a field I have an international number +331234567 but when I am loading the file with...
    3. Strange FDF problem
      I am developing an fdf that fills in 3 form values into my pdf, and am having some strange problems. First off, this project is sort of an...
    4. Strange problem on IE6
      I have created a movie with Flash Pro 8. Strange problem is that on some computers (not all of them), it seams that all objects that have filters...
    5. [PHP] Strange Problem
      This is an IIS issue. The install.txt has specific information on this topic, have a look. Also, this comes up a lot and the following bug report...
  3. #2

    Default Re: strange problem with sed

    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
    Warren Block Guest

  4. #3

    Default Re: strange problem with sed

    Warren Block <wblock@wonkity.com> wrote:
    > 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/"
    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
    [email]johnww@worldpath.net[/email] communicate ideas, one is to conceal ideas, and
    the third is to conceal the absence of ideas.
    --Otto Jespersen
    John Wingate Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139