4 ms·
Rsh: Ruby SHell
- jacknews 3y ago"Aliases (called nicks in rsh)" Just, why? Everything else calls them aliases. Everyone knows what an alias is. Is this something that works differently and so needs a different name? If 'alias' was a badly chosen 'standard', then there's a case to try to change it, but 'alias' seems to be quite precise and fitting to me.
- jeremymcanally 3y agoProbably because “alias” is a keyword in Ruby.
- jacknews 3y agoSure, and it means exactly what you expect it to mean in ruby (though tinged with 'bad idea', in the case of aliasing variable names), so that's even more reason to use it (find a way to mesh with irb or whatever they're using as 'backend'). It's 'ruby shell' after all.
- hydroid7 3y agoNice gem from the ruby world.
- dorianmariefr 3y agoI have a script called each that executes Ruby on each line of input https://rubygems.org/gems/dorian-each https://rubygems.org/gems/dorian-each
- revskill 3y agoNeed windows version. Windows Terminal is the worst thing in the world.
- jcpst 3y agoNot the same thing though. Windows Terminal is a terminal emulator. Rsh is a shell. Assuming rsh runs fine on windows, one could make another profile in Windows Terminal that starts in rsh.
- Alifatisk 3y agoIsn't this gem cross-platform?
- geir_isene 3y agoShould be. Anyone with Windows, please do try, and I would be grateful for a quick report.
- deleted 3y ago[deleted]
- andy81 3y agoOnce it's on Windows you can add it as a shell in Windows Terminal. You might be mixing up cmd with windows terminal though. Cmd is truly crap which is why it was replaced with powershell 20 years ago.
- layer8 3y agoCMD wasn’t replaced. PowerShell exists alongside it.
- pelasaco 3y agoWSL and you just can completely avoid Windows Terminal if you work on Windows but not with Windows. I.e I do devops, linux development in my Windows Box running an openSUSE box in WSL. It integrates pretty well with visual code for instance.
- revskill 3y agoSadly, to use WSL effectively, you need to configure high enough Disk and Memory, the issue is WSL doesn't know how to clean up deleted volume.
- pino999 3y agoIt uses system which calls sh. So a script might behave differently on different systems.
- pino999 3y agoFor the rest it looks good. I have a knack for stack based languages. I enjoy it includes one.
- _joel 3y agoNot great naming imho, this has been around for 40 years.. https://en.wikipedia.org/wiki/Remote_Shell https://en.wikipedia.org/wiki/Remote_Shell
- layer8 3y agoCould have named it rbsh. Though the pronunciation could be controversial.
- petepete 3y agorubbish!
- Fire-Dragon-DoL 3y agorbsh would be very recognizable for ruby users (rb being the file extension commonly used)
- geir_isene 3y agorbsh is actually a cool idea. I just might adopt that.
- ninefathom 3y agoSeconded. Naming an interactive language shell after ssh's older, insecure cousin just seems like begging for trouble. I'm imagining some auditor seeing an "rsh" binary on a Linux system and dinging the system on it, and weeks of back and forth emails and meetings required to determine that, no, in fact, this is not remote shell, it's Ruby shell, and it's actually not a valid audit finding. And, of course, that's completely omitting the binary collision issue because frankly anybody with "old" rsh installed deserves whatever pain they get.
- RGBCube 3y agoHow fast(or slow...) is the startup time?
- KerrAvon 3y agoHaven’t tried this project yet, but the Ruby interpreter itself starts up very quickly, so I’d expect it to be essentially instant on modern hardware.
- walski 3y ago(slight ot, sorry!) This brings back great memories of one of the best assignment from my college time: We had an "Agile web development" course (~2007) with a precursory Ruby 101 workshop as well as a pre-course assignment to "create a shell in Ruby". It was such a joy to hack on this and learn that way. It was clearly wayyy too vast of a task to ever _complete_ it, but I learned so much Ruby there and couldn't stop working on the project. Thanks Carsten Bormann for being a great teacher! And thanks op for reminding me of this :)
- deleted 3y ago[deleted]
- cyclotron3k 3y agoJust a little screen recording of what we can expect would be awesome
- geir_isene 3y agoScreencast here: https://youtu.be/4P2z8oSo1u4 https://youtu.be/4P2z8oSo1u4
- geir_isene 3y agoThat's an excellent request. Thanks. Will do.
- cyclotron3k 3y agoNot sure if you've come across asciinema [1] before. I haven't used it myself, but it seems pretty popular for this kind of screen recording. [1] https://asciinema.org/ https://asciinema.org/
- geir_isene 3y agoThanks. Will check that out.
- omoikane 3y agoI think this is not a general shell like bash or csh, more of a custom REPL for some specific set of commands. A critical feature of every other shell is how they handle pipes, and this one doesn't seem to have gotten that far yet. Perhaps it would have been better to wrap the limited shell functionalities in in gem instead, and run that inside `irb`. Currently the majority of the lines appears to be reimplementing a REPL, but those would come for free with `irb`.
- geir_isene 3y agoNope. It handles pipes and everything else as it shells out on system()
- omoikane 3y agoBut the outputs of those system() calls aren't accessible to rsh, unlike other shells where I might be able to do VARIABLE=$(command). I was looking for something more like IO.popen() and rsh does not seem to have those.
- deleted 3y ago[deleted]