News for hackers. Stuff that matters.
Re:PowerShell is open sourced and is available on Linux by emodendroket on Thursday August 18, 2016 @12:28PM (#12313905)
Imagine for a second that the DB can't do it and you need to filter the STDOUT output.
Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Thursday August 18, 2016 @01:14PM (#12314406)
That doesn't sound hard at all. AWK, anyone?
Re:PowerShell is open sourced and is available on Linux by emodendroket on Thursday August 18, 2016 @03:12PM (#12315478)
Writing awk to do it is definitely more work than calling obj.Property though.
Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Thursday August 18, 2016 @04:26PM (#12316079)

  $mysql_cmd|awk -F\| '$2 == "what you want the second row to match" {print $0}'
Not that much more work. And you can do better if you can coax mysql to emit proper DSV.
Re:PowerShell is open sourced and is available on Linux by emodendroket on Friday August 19, 2016 @09:01AM (#12319665)
That kind of stuff adds up fast in an interactive shell.
Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Friday August 19, 2016 @10:31AM (#12320243)
...Which is why you write a script to do it if it comes up often.

Extendable tooling!

Re:PowerShell is open sourced and is available on Linux by dangerlibrary on Thursday August 18, 2016 @12:33PM (#12313966)
Okay, I've imagined it. It does seem terrible.

Fortunately, that's not a world any of us live in.

Re:PowerShell is open sourced and is available on Linux by PeCaN on Thursday August 18, 2016 @12:40PM (#12314035)
Er, it's a world all of us live in. Say, for example, ‘ps’ or ‘ls -1l’.

Then you end up using awk, which is rather like a half-assed version of powershell to work around shortcomings with the unix everything-is-a-string design.

Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Thursday August 18, 2016 @04:29PM (#12316098)
AWK isn't a workaround. It's a tool for processing tabular data, in a textual format. The fact that it can solve so many problems is actually a strength of the EIAS design.
Re:PowerShell is open sourced and is available on Linux by dangerlibrary on Thursday August 18, 2016 @02:54PM (#12315316)
Parent comment was talking about parsing the raw output from a database in stdout. That's what I was responding to, and I'm not wrong.
Re:PowerShell is open sourced and is available on Linux by emodendroket on Thursday August 18, 2016 @12:37PM (#12314001)
OK, but now imagine it's not a database, because there are programs that do act this way.
Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Thursday August 18, 2016 @04:31PM (#12316112)
And those programs usually emit proper CSV. You could use regex to match on what you want, but AWK was literally built for this. It's fantastic, it works great, and if you don't use that tool that was built to solve your problem, that's your own lookout.
Re:PowerShell is open sourced and is available on Linux by emodendroket on Monday August 22, 2016 @09:45AM (#12336266)
I don't think awk is actually capable of parsing CSVs in all cases.
Re:PowerShell is open sourced and is available on Linux by qwertyuiop924 on Monday August 22, 2016 @01:07PM (#12337740)
It doesn't parse escapes, IIRC, but those are rarely emitted.