News for hackers. Stuff that matters.
Re:The Unreasonable Effectiveness of C by georgeorwell on Friday January 11, 2013 @06:39AM (#5042263)
I think you mean:

  $ echo "$PARENT" | sed 's_r/x_r$/_'
P.S. It's a bit hard to believe I misread that... thanks.
Re:The Unreasonable Effectiveness of C by dbaupp on Friday January 11, 2013 @09:40AM (#5042824)
Random tip: in Bash (at least), you can execute the previous command with some changes using ^..^..^, e.g.

  $ echo john regehr | sed s/hr/xx/
  john regexx
  $ ^r/x^r$/^
  echo john regehr | sed s/hr$/x/
  john regex
(The second last line is just bash printing the new command.)
Re:The Unreasonable Effectiveness of C by eru on Friday January 11, 2013 @07:21AM (#5042363)
My sed knowledge isn't very advance. What is your invocation supposed to do?
Re:The Unreasonable Effectiveness of C by dbaupp on Friday January 11, 2013 @09:37AM (#5042807)
You can use any separator you want in an s/../../ expression, not just /, in this case the separator is _ (this technique allows you to use / without creating a "picket fence": s/r\/x/r$\//).

So the regex just means replace "r/x" with "r$/".