Hacker News new | ask | show | jobs
by zokier 1637 days ago
I'm in the opinion that tables would make a lot of sense as first-class citizens for shell environments. Lots of data typically handled in shells is inherently tabular in nature (for example the outputs of ls and ps etc) and some of the common tools also are intended for tables (awk in the forefront, but also cut and sort as examples). But in practice lot of it is currently very ad-hoc, and handles any sort of edge cases poorly.

osquery already demonstrates that lot of info can be structured into tables, but what I feel is missing is more convenient, shell-like language environment to work with such data.

1 comments

I think Microsoft Powershell [0] sort of approaches what you’re describing. It’s not exactly table-oriented, but object-oriented such that there’s a lot more structure to data than in traditional command line environments. For example, their equivalent of ls returns an array of objects (i.e. rows) which you can filter, sort, etc. based on the properties of those objects.

[0]: https://docs.microsoft.com/en-us/powershell/scripting/overvi...

Seconded. It also comes with Import-CSV and Export-CSV. And cmdlets like Select-Object and Where-Object.

  Get-Service | Where-Object {$_.Status -eq "Stopped"}
Looks pretty close to what's being described.