8 ms·
I don't feel the plain text portion has aged well at all in regards to composability. It leads to a lot of headache as the complexity of the task grows because
by AnIdiotOnTheNet 8y ago
I don't feel the plain text portion has aged well at all in regards to composability. It leads to a lot of headache as the complexity of the task grows because of the in-band signaling and lack of universal format. I think it is high time the standard unix tools were replaced with modern equivalents that had a consistent naming scheme and pipelined typed object data instead of plain text.
- merlincorey 8y agoI think you should check out Powershell.
- alexeldeib 8y agoThis made me chuckle, because it's incredibly accurate. I started with bash and am still naturally more comfortable there for general purpose work. PowerShell is annoyingly verbose sometimes and has its own WTF moments, but there are waaay fewer surprises when working with complex scripts and variables.
- brirec 8y agoIt’s not included anywhere, but PowerShell is open source and you can install it on *nix now! Obviously the things that integrate with Windows aren’t there, but the object-oriented pipelining sure is.
- jedieaston 8y agoI believe the AD and Azure tools work, and the other ones needed for remotely managing Windows Server, although I could be wrong.
- mwj 8y agoIs that a joke? The syntax is worse than PHP and it doesn't run on Linux
- CupOfJava 8y agoIt runs on linux: https://azure.microsoft.com/en-ca/blog/powershell-is-open-sourced-and-is-available-on-linux/ https://azure.microsoft.com/en-ca/blog/powershell-is-open-so... https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6 https://docs.microsoft.com/en-us/powershell/scripting/setup/...
- AnIdiotOnTheNet 8y agoI'm actually a fan of Powershell, but unix people take it as a personal insult if you try and tell them their 70s-era tooling is inferior in some way to something designed with 30 years of hindsight.
- h1d 8y agoUsed PowerShell to code a small script and simply making md5 of a string is enough to make you feel nuts. The UNIX style. echo -n 'string' | md5 Compared to that obvious command, this is utter madness. You can't write a single thing without googling. $string = "string" $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider $utf8 = new-object -TypeName System.Text.UTF8Encoding $hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($string))) $hash = $hash.ToLower() -replace '-', '' No shit the Bash on Windows is a godsend.
- pjmlp 8y agoOf course, because someone wrote a md5 executable for you to call. You can do the same on PowerShell and write a pipeline just the same way.
- h1d 8y agoYou're right that a shell alone can't calculate md5 but a separate md5 binary does it for you, but the question still stands when the common answer on the internet seems to be to write that cryptic code as that's probably the easiest way provided on PowerShell. The best alternative I could find is some community maintained PowerShell extension (with just 177 GitHub stars now), which is far better but the lack of interest in making PowerShell act more straightforward is weird. "string" | Get-Hash -Algorithm MD5 (https://github.com/Pscx/Pscx https://github.com/Pscx/Pscx) Still feels funny to read the GGP's comment. > 70s-era tooling is inferior in some way to something designed with 30 years of hindsight
- TeMPOraL 8y agoStill, all that stops PS from being a better shell in linuxland is some people writing PS-equivalents of all the small executables that ship with your linux distribution.
- skissane 8y agoIf Unix pipes gained support for exchanging some kind of out-of-band signalling messages, then CLI apps could tag their output as being in a particular format, or even the two ends of a pipe could negotiate about what format to use. If sending/receiving out-of-band messages was by some new API, then it could be done in a backwards compatible way. (e.g. if other end starts reading/writing/selecting/polling/etc without trying to send/receive a control message first, then the send/receive control message API returns some error code "other end doesn't support control messages") I have suggested this before: https://news.ycombinator.com/item?id=14675847 https://news.ycombinator.com/item?id=14675847 (But I don't really care enough about the idea to try to implement it... it would need kernel changes plus enhancements to the user space tools to use it... but, hypothetically, if PTYs got this support as well as pipes, your CLI tool could mark its output as 'text/html', and then your terminal could embed a web browser right in the middle of your terminal window to display it.)
- vram22 8y ago>your CLI tool could mark its output as 'text/html', and then your terminal could embed a web browser right in the middle of your terminal window to display it. Ha ha, I had dreamed up something like this in one of my wilder imaginings, a while ago: A command-line shell at which you can type pipelines, involving some regular CLI commands, but also GUI commands as components, and when the pipeline is run, those GUIs will pop up in the middle of the pipeline, allow you to interact with them, and then any data output from them will go to the next component in the pipeline :) Don't actually know if the idea makes sense or would be useful.
- v_lisivka 8y agohttp://www.xml.com/pub/2000/06/07/xmlterm/ http://www.xml.com/pub/2000/06/07/xmlterm/
- chriswarbo 8y ago> A command-line shell at which you can type pipelines, involving some regular CLI commands, but also GUI commands as components, and when the pipeline is run, those GUIs will pop up in the middle of the pipeline, allow you to interact with them, and then any data output from them will go to the next component in the pipeline There seems to be some precedent for this sort of thing. For example, DVTM can invoke a text editor as a "filter", where the editor UI is drawn on stderr and result saved to stdout.
- jolmg 8y agoPlain text was chosen to interface the various programs of Unix OSes because it's the least common denominator all languages share. It also forces all tools to be composable with each other. You can take output text that was obviously not formatted for easy consumption by another program and still use all the information it outputs for input into another program. Programs that were only thought to have users handling its input and output (ncurses apps) can also be forced to be used by programs through things like the expect TCL program or Ruby's expect library. If programs used typed data, they'd still need the option to output text to present results in a format the user can understand. To do this, a negotiation protocol could be established, like skissane said. This, in my opinion, is BAD, because then there's the possibility or probability that they'll be differences in the information conveyed in the different formats. I believe that the use of plain text as the universal format of communication between programs is one of the greatest design decisions for Unix and CLI.
- oblio 8y agoHow hard is it to come up with a object format (more like a data structure format since I wouldn't want logic/code being passed around) and then come up with a standard text serializer for it? Not that hard, in my opinion. You'd standardize it once via an RFC and you'd be done with it. I don't think your problem is as big as you say it is. The real problem is that this pile of code we already have kind of works and it's already making trillions for its users. Changing the whole ecosystems would cost millions and millions, for only a very long term and unclear benefit. In other words, worse is better.
- dullgiulio 8y agoIt's not about backwards compatibility. It's about the fact that text is what we read as humans and if commands parse the same format there is only one output format to implement.
- oblio 8y agoI don't believe that. Text for human consumption, in a well designed UI (and I mean even a CLI one!), should be different from text for machine consumption. Human consumption generally optimizes for characteristics almost diametrically opposed from machine consumption. Of course, who am I kidding, in real life we have some sort of crappy text interface which is half-baked both for humans and for machines. But we've been using it for almost half a century and it's too widespread to redo, so there we are, plowing through it daily.
- deleted 8y ago[deleted]