7 ms·
What's a decent replacement shell? Sometimes I think there should be one, with all backwards compatibility for if/looping thrown out, but still adhering to the
by qiqitori 6y ago
What's a decent replacement shell? Sometimes I think there should be one, with all backwards compatibility for if/looping thrown out, but still adhering to the core concept of mostly being made of a handful of builtins and otherwise executing commands (i.e., without having to type system("") or exec("") etc. to execute commands).
- mkj 6y agoPython with sh.py is often alright in the place of a shell script.
- majkinetor 6y agoReally ? sh.ls("-l", "/tmp", color="never")
- majkinetor 6y agoPowerShell obvioslly, if you can handle awesome. Now there will be tones of angry dudes complaining about: - Optional verbosity - 1-5s startup time on some machines - Random MS agenda to conquer and destroy - Random problem with usage that is solved by RTFM - Suggesting python, ruby, go, node, perl and whatever non-shell language Thankfully, ignoring is still a great human feature.
- jen20 6y agoFirst, I like PowerShell - sufficiently much to have used it as a login shell _on macOS_ for a while. However, you grossly overestimate the “awesome”. To answer each “angry dude” point in turn: - The verbosity is fine - in scripts, one should fully expand command names. Interactively, `gci` is fine (or the `ls` alias, though some of the default aliases are travesties). - The startup time is insane. I start a new terminal window hundreds of times per day, and the startup time is what made me abandon POSH. - Apache 2 licensed, so I don’t care. I do default to assuming that MSFT are doing something shady though, and I’m right [1]. - RTFMing is perfectly fine (and Get-Help has high quality documentation for built-ins), but one must accept that most users will not. ISE (if it existed outside of Windows) was a nice workaround for needing this. - Python, Ruby, Go, Node and Perl are all more portable (see my last comment about FreeBSD support). As an interactive shell, nushell [2] is probably the closest thing to the PowerShell experience which is not tied to .NET Core. [1]: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_telemetry?view=powershell-7.1 https://docs.microsoft.com/en-us/powershell/module/microsoft... [2]: https://github.com/nushell/nushell https://github.com/nushell/nushell
- majkinetor 6y agoSo your answers just confirm my 'angry dude' bullet list. As far as I can see, the only really problematic one is startup time, which is surely something that will be resolved in the future. I witnessed this only rarely while I use PowerShell on Windows and Linux - it was on windows and it was on VM with very slow disk, and some modules that each keep functions separated by files. I welcome nushell development, but you can't really compare it to pwsh - even if they continue developing it, its decade or so from being usable as main shell. > you grossly overestimate the “awesome”. Nah, its awesome. I save bunch of time any time I open the PowerShell. And any time when one tries to be quicker in some other language one is not, eventually.
- jen20 6y agoIn that case you cannot see sufficiently far: telemetry on by default is a non-starter. If the startup time were going to be fixed “real soon now”, it would have improved since 2006. It has not, especially when basic usability enhancements like “posh-git” are enabled. > [nushell is a] decade or so from being usable as a main shell News to me. I replaced Powershell with NuShell.
- majkinetor 6y ago> it would have improved since 2006 cross platform pwsh is just few years old > I replaced Powershell with NuShell. Sure, you can replace it with LOLCAT either, its totally legit. Regarding startup time, I can't believe there is such drama. If that troubles you so much, you can easily workaround it by always keeping powershell process pool ready in the background (1 or 2 suspended instances until you use them).
- jen20 6y ago> cross platform pwsh is just few years old It's slow on Windows too.
- scbrg 6y ago> you can easily workaround it by always keeping powershell process pool ready in the background (1 or 2 suspended instances until you use them). This is a pretty absurd take when the discussion is about alternative shells for writing scripts. Shell scripts are everywhere. A fairly heavily used UNIX box might easily execute hundreds of shell scripts every minute. A startup time of several seconds makes it completely unusable.
- orthoxerox 6y agoDoes it have to be a shell? I would be fine with having bash as a shell for basic stuff like piping and a non-interactive scripting language for actual scripts.
- hnlmorg 6y agoI've written one specifically to solve if and looping: https://github.com/lmorg/murex https://github.com/lmorg/murex (docs: https://murex.rocks https://murex.rocks) Others I've not used are oil shell, which aims to be a better Bash. Elvish, which has a heck of a lot of similarities with my own project (and is arguably more mature too). There are REPL shells in LISP, Python and all sorts too. So there are options out there if you want a $SHELL and happy to break from POSIX and/or bash compatibility.
- TeMPOraL 6y agoSeconding PowerShell. Or some future development that files off the rough edges, but otherwise follows the same sane principle of piping objects instead of unstructured text :).
- michaelcampbell 6y agoSo. Much. Typing. though.
- netmare 6y agoCommand/type aliases and autocompletion make this a non-issue on the console and advanced code editors. Personally, I don't mind the verbosity even when using plain editors, like Notepad2, my text/script editor of choice. Extra-long command names and deeply namespaced .Net types can be a chore both to read and write, but I find the *nix tools way too cryptic. Never could get used to them, but then again, I've been on DOS/Windows all my life since the 90s. To be honest, I'd occasionally get frustrated and think about switching to Linux. However, Python and PowerShell are the two things that have kept me on Windows. The fact that they are both open-source and cross-platform is just the cherry on top.
- deleted 6y ago[deleted]
- lmm 6y agotclsh is very nice for scripts - it's a first-class part of TCL which is a proper grown-up programming language, but it pulls it very much into being a shell, and it's been around for decades so there's a decent chance that any old unix system will have it installed.