Live data from Hacker News

Useful sed scripts and patterns

github.com

121–124 of 124 posts

Re: Useful sed scripts and patterns

#121
post #120
post #35

Earlier quoted context omitted.

Heh, Not over here doing arm chair yucking someone's yum, to you and everyone else in this shrub of the conversation. If you guys want to do SCA or model trains with ancient programming languages, go all in. I play around with Forth and APL as well. If the premise is the title of the post "day to day usage ..." then total task efficiency is important. Are you moving the goal posts and putting words in my mouth? If I…

Would you please not post in the flamewar style to HN, regardless of how provocative another comment was or you feel it was? This is not at all what we're trying for here. https://news.ycombinator.com/newsguidelines.html

I don’t know what flame war style is, not playing dumb. I think the person behind the provocative comment isn’t much different than me.

I thought my comment might land ok, which due to a lack of response might have. It explained educated and

I might have typed the same thing in a different time.

*edit, it would be fun to have a forum board that allowed for out of band semantic information so … being cut off

Re: Useful sed scripts and patterns

#122
post #120

Earlier quoted context omitted.

Would you please not post in the flamewar style to HN, regardless of how provocative another comment was or you feel it was? This is not at all what we're trying for here. https://news.ycombinator.com/newsguidelines.html

I don’t know what flame war style is, not playing dumb. I think the person behind the provocative comment isn’t much different than me. I thought my comment might land ok, which due to a lack of response might have. It explained educated and I might have typed the same thing in a different time. *edit, it would be fun to have a forum board that allowed for out of band semantic information so … being cut off

Actually when I re-read your comment it doesn't seem so flamewarrish to me—sorry! a lot of the time I'm skimming these things in haste.

A couple bits that do correspond to 'the flamewar style', though, are when users start telling each other to "chill a bit"; and when people start arguing about "moving the goal posts and putting words in my mouth". It's a reliable sign of bad internet discussion when people start arguing about they are or aren't saying (rather than talking about whatever the ostensible subject was).

Re: Useful sed scripts and patterns

#123

Earlier quoted context omitted.

Yeah I redid some scripts on my team for my own usage because our team bash guru maintained them and didn't want anyone to change them. So I did my own versions in python. Sure they were mostly 2x+ as long but they were very easy to read and modify and test. The bash guru finds out and brings it up at a team meeting trying to shame me, but it ended up with my boss asking the team, and they voted on using my scripts i…

I have done something similar, what I really found worked well was to wrap the bash scripts in python to instrument them and if they just operate on data, you can even spawn another command and run them both at the time confirming that the output matches. Great way to have confidence in a port and provide for a fallback path. Eventually the new code will take over the old code and the old code will wither and die.

It seems like when a bash script gets over say 50 lines or so I start doubting whether something should be a bash script :) . I saw an IRC client written entirely in bash once and it was quite a resource of esoteric bash scripting haha.

Re: Useful sed scripts and patterns

#124
post #29

Earlier quoted context omitted.

If I measure time to solve a problem and not line count, using a language like Python or Ruby might be 2x the lines , for a line count approaching zero anyways, not sure that matters. Performance is comparable and I don't need to relearn anything and someone else who doesn't know awk/sed doesn't need to learn it. And when one is using awk/sed that script is often invoked from a shell, bash for instance. And since the…

> Awk/sed made sense for the time and place they are from, but things have changed. Don't do that. Do not assume something is of no use because you don't know how to use it. Double that recommendation for tools that have widespread use. There is a reason they're used everywhere. In the case of awk/sed/perl: Nothing beats them for composition in one-liner text processing pipelines.

I have moved on to structured data, awk and sed handle line oriented text formats.

Don't assume I don't know how to use it. :)

One line verses ten, I'll take the more readable thing over the APL.

Post reply on HN