Re:PowerShell is open sourced and is available on Linux
by qwertyuiop924 on Friday August 19, 2016 @12:09PM
(#12321043)
DSV is the default format for many unix utils, and AWK and cut parse it easily.
[ Parent
| on HN ]
Re:PowerShell is open sourced and is available on Linux
by gpvos on Sunday August 21, 2016 @03:30PM
(#12332340)
Yes, of course; that is one end of the "middle ground" I described. The problem is that in Unix, there is no common convention for how to escape the delimiter, so you cannot pass arbitrary strings. CSV can do this, with the proper tooling. Being able to pass around arbitrary strings is quite valuable, and although it is not quite the same as passing objects around, it has the advantage of still being human-readable text. That is why I called it a "useful middle ground" between Powershell and the delimiter-separated fields of Unix tools. However, you do need special tools such as csvkit, as Unix tools like awk, sort and cut cannot properly parse it.
Re:PowerShell is open sourced and is available on Linux
by qwertyuiop924 on Monday August 22, 2016 @12:51PM
(#12337615)
Oh, you can pass arbitrary strings, you just can't pass arbitrary strings as part of compound datastructures. The closest you can get is using null or some other weird character to separate lines ($RS='\0' in awk), and something similar for field separation (like -0 in find, which is $FS='\0' in awk). But \0 is only one special character, so you need another one.