Hacker News new | ask | show | jobs
by gnbfulbvgjbvv 3025 days ago
S/iOS/IOS
2 comments

s/^S/s
s/$/\//
You'd think no one actually uses sed any more...
Lots of people use vim, which all of these examples would also work in

EDIT: except for the missing trailing "/"

I use ed occasionally, just for fun. It's perfectly happy with s commands not being terminated by the separator.
It can also be Perl, as Perl supports `s///` syntax.
Doesn't need to be forward slashes (in either Perl or sed).

In fact that last example I might write as either of the two following ways:

    s,$,/,
    s{$}{/}    # this is supported in Perl but not sed
to avoid having to escape the replacing character.
What are the alternatives?
I've seen folks use awk for some of those tasks, and another four letter programming language that i won't name.
I don't know if it's what you want, but it's what you get. [0]

It' all magic! [1]

[0]https://groups.google.com/forum/m/?hl=en#!msg/comp.lang.perl... [1]https://groups.google.com/forum/m/?hl=en#!msg/comp.lang.perl...

Ruby isn't that bad.
Correct, I'm too damn used to dealing with Apple stuff. It's also like another form of cancer, but a lot less pervasive and far more noticeable.